Version 0.2.0.0.

svn merge -r 13640:13839 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@13841 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/.gitignore b/.gitignore
index e8355d6..628df58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,3 +66,6 @@
 # Compiled python binaries
 *.pyc
 third_party/gsutil/*/gsutilc
+
+# From the Mac OS X Finder
+.DS_Store
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index 1880f3c..c32c0d6 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -167,6 +167,8 @@
   private static final String SHOW_KEYWORD = "show";
   private static final String STATIC_KEYWORD = "static";
   private static final String TYPEDEF_KEYWORD = "typedef";
+  // does not exist in specification
+  private static final String PATCH_KEYWORD = "patch";
 
 
   public static final String[] PSEUDO_KEYWORDS = {
@@ -324,6 +326,9 @@
           isTopLevelAbstract = true;
           topLevelAbstractModifierPosition = position();
         }
+        // skip "patch" before "class"
+        if (peek(1) == Token.CLASS && optionalPseudoKeyword(PATCH_KEYWORD)) {
+        }
         // Parse top level element.
         if (optional(Token.CLASS)) {
           isParsingClass = true;
@@ -2662,7 +2667,7 @@
       return done(result);
     }
     consume(Token.CONDITIONAL);
-    DartExpression yes = parseExpression();
+    DartExpression yes = parseExpressionWithoutCascade();
     expect(Token.COLON);
     DartExpression no = parseExpressionWithoutCascade();
     return done(new DartConditional(result, yes, no));
diff --git a/compiler/java/com/google/dart/compiler/parser/DartScanner.java b/compiler/java/com/google/dart/compiler/parser/DartScanner.java
index d5bbbc6..52599ed 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartScanner.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartScanner.java
@@ -1210,8 +1210,8 @@
         // Raw strings.
         advance();
         if (is('\'') || is('"')) {
+          reportError(position() - 1, ParserErrorCode.DEPRECATED_RAW_STRING);
           Token token = scanString(true);
-//          reportError(position() - 1, ParserErrorCode.DEPRECATED_RAW_STRING);
           return token;
         } else {
           return Token.AT;
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 0c74025..8fad370 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -426,10 +426,20 @@
       Token operator = node.getOperator();
       switch (operator) {
         case ASSIGN: {
-          Type rhs = nonVoidTypeOf(rhsNode);
-          if (!hasInferredType(lhsNode)) {
-            checkAssignable(rhsNode, lhs, rhs);
+          // prepare RHS type
+          Type rhs = getInvocationArgumentType(rhsNode);
+          try {
+            if (!hasInferredType(lhsNode)) {
+              if (checkAssignable(rhsNode, lhs, rhs)) {
+                inferFunctionLiteralParametersTypes(rhsNode, lhs);
+              }
+            }
+          } finally {
+            if (rhsNode instanceof DartFunctionExpression) {
+              rhsNode.accept(this);
+            }
           }
+          // may be replace type of variable
           setVariableElementType(lhsNode.getElement(), rhs);
           checkAssignableElement(lhsNode);
           // if cascade, then use type of "lhs" qualifier
@@ -954,9 +964,10 @@
           List<DartParameter> parameterNodes = literal.getFunction().getParameters();
           // try to infer types of "normal" parameters
           List<Type> requiredNormalParameterTypes = requiredType.getParameterTypes();
-          for (int i = 0; i < requiredNormalParameterTypes.size(); i++) {
-            DartParameter parameterNode = parameterNodes.get(i);
+          int n = Math.min(requiredNormalParameterTypes.size(), parameterNodes.size());
+          for (int i = 0; i < n; i++) {
             Type requiredNormalParameterType = requiredNormalParameterTypes.get(i);
+            DartParameter parameterNode = parameterNodes.get(i);
             inferVariableDeclarationType(parameterNode, requiredNormalParameterType);
           }
         }
@@ -2723,6 +2734,11 @@
       }
     }
 
+    /**
+     * Almost same as {@link #nonVoidTypeOf(DartNode)}, but does not visit
+     * {@link DartFunctionExpression}, because we know its type already and want to infer types of
+     * arguments, and then propagate them into body.
+     */
     private Type getInvocationArgumentType(DartExpression argument) {
       // We are interesting in the type of expression, without name.
       if (argument instanceof DartNamedExpression) {
@@ -2764,15 +2780,21 @@
 
     @Override
     public Type visitVariable(DartVariable node) {
-      Type result = checkInitializedDeclaration(node, node.getValue());
-      // if no type declared for variables, try to use type of value
-      {
-        DartExpression value = node.getValue();
-        if (value != null) {
-          Type valueType = value.getType();
-          inferVariableDeclarationType(node, valueType);
+      DartExpression value = node.getValue();
+      // if type is declared and right side is closure, infer its parameter types
+      if (value != null) {
+        Type varType = node.getElement().getType();
+        if (isExclicitlySpecifiedType(varType)) {
+          inferFunctionLiteralParametersTypes(value, varType);
         }
       }
+      // prepare type of value
+      Type result = checkInitializedDeclaration(node, value);
+      // if no type declared for variables, try to use type of value
+      if (value != null) {
+        Type valueType = value.getType();
+        inferVariableDeclarationType(node, valueType);
+      }
       // done
       return result;
     }
@@ -2866,16 +2888,22 @@
       if (accessor != null) {
         return typeOf(accessor);
       } else {
-        Type result = checkInitializedDeclaration(node, node.getValue());
+        DartExpression value = node.getValue();
+        // if type is declared and right side is closure, infer its parameter types
+        if (value != null) {
+          Type fieldType = node.getElement().getType();
+          if (isExclicitlySpecifiedType(fieldType)) {
+            inferFunctionLiteralParametersTypes(value, fieldType);
+          }
+        }
+        // prepare type of value
+        Type result = checkInitializedDeclaration(node, value);
         // if no type declared for field, try to use type of value
         // only final fields, because only in this case we can be sure that field is not assigned
         // somewhere, may be even not in this unit
-        if (node.getModifiers().isFinal()) {
-          DartExpression value = node.getValue();
-          if (value != null) {
-            Type valueType = value.getType();
-            inferVariableDeclarationType(node, valueType);
-          }
+        if (node.getModifiers().isFinal() && value != null) {
+          Type valueType = value.getType();
+          inferVariableDeclarationType(node, valueType);
         }
         // done
         return result;
@@ -3379,4 +3407,9 @@
       }
     }
   }
+
+  private static boolean isExclicitlySpecifiedType(Type fieldType) {
+    return fieldType != null && TypeKind.of(fieldType) != TypeKind.DYNAMIC
+        && !fieldType.isInferred();
+  }
 }
diff --git a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
index 989bca8..f742650 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
@@ -355,6 +355,12 @@
         errEx(ParserErrorCode.DEPRECATED_USE_OF_FACTORY_KEYWORD, 1, 15, 7));
   }
 
+  public void test_deprecatedRawString() {
+    parseExpectWarnings(
+        "String s() { return @'s'; }",
+        errEx(ParserErrorCode.DEPRECATED_RAW_STRING, 1, 21, 1));
+  }
+
   public void test_useExtendsInTypedef() {
     parseExpectErrors(Joiner.on("\n").join(
         "// filler filler filler filler filler filler filler filler filler filler",
diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
index bf007e6..4b96e97 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
@@ -80,6 +80,13 @@
         "  int as = 0;",
         "}"));
   }
+  
+  public void test_patch() {
+    DartUnit unit = parseUnit("patch.dart", Joiner.on("\n").join(
+        "patch class A {",
+        "}"));
+    assertEquals(1, unit.getTopLevelNodes().size());
+  }
 
   public void test_index_literalMap() {
     parseUnit("test.dart", Joiner.on('\n').join(
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 961a981..3bfd3fa 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -3074,7 +3074,65 @@
         "");
     assertInferredElementTypeString(testUnit, "v", "Event");
   }
-  
+
+  public void test_typesPropagation_parameterOfClosure_assignVariable() throws Exception {
+    analyzeLibrary(
+        "// filler filler filler filler filler filler filler filler filler filler",
+        "class Event {}",
+        "typedef void EventListener(Event event);",
+        "main() {",
+        "  // local variable assign",
+        "  {",
+        "    EventListener listener;",
+        "    listener = (e) {",
+        "      var v1 = e;",
+        "    };",
+        "  }",
+        "  // local variable declare",
+        "  {",
+        "    EventListener listener = (e) {",
+        "      var v2 = e;",
+        "    };",
+        "  }",
+        "}",
+        "");
+    assertInferredElementTypeString(testUnit, "v1", "Event");
+    assertInferredElementTypeString(testUnit, "v2", "Event");
+  }
+
+  public void test_typesPropagation_parameterOfClosure_assignField() throws Exception {
+    analyzeLibrary(
+        "// filler filler filler filler filler filler filler filler filler filler",
+        "class Event {}",
+        "typedef void EventListener(Event event);",
+        "class Button {",
+        "  EventListener listener;",
+        "}",
+        "EventListener topLevelListener;",
+        "main() {",
+        "  // top-level field",
+        "  {",
+        "    topLevelListener = (e) {",
+        "      var v1 = e;",
+        "    };",
+        "  }",
+        "  // member field",
+        "  {",
+        "    Button button = new Button();",
+        "    button.listener = (e) {",
+        "      var v2 = e;",
+        "    };",
+        "  }",
+        "}",
+        "EventListener topLevelListener2 = (e) {",
+        "  var v3 = e;",
+        "};",
+        "");
+    assertInferredElementTypeString(testUnit, "v1", "Event");
+    assertInferredElementTypeString(testUnit, "v2", "Event");
+    assertInferredElementTypeString(testUnit, "v3", "Event");
+  }
+
   /**
    * Helpful (but not perfectly satisfying Specification) type of "conditional" is intersection of
    * then/else types, not just their "least upper bounds". And this corresponds runtime behavior.
diff --git a/lib/_internal/libraries.dart b/lib/_internal/libraries.dart
index 239cec4..651afcb 100644
--- a/lib/_internal/libraries.dart
+++ b/lib/_internal/libraries.dart
@@ -140,13 +140,13 @@
    */
   final bool implementation;
 
-  const LibraryInfo(this.path, [
-           this.category = "Shared",
-           this.dart2jsPath,
-           this.dart2jsPatchPath,
-           this.implementation = false,
-           this.documented = true,
-           this.platforms = DART2JS_PLATFORM | VM_PLATFORM]);
+  const LibraryInfo(this.path, {
+                    this.category: "Shared",
+                    this.dart2jsPath,
+                    this.dart2jsPatchPath,
+                    this.implementation: false,
+                    this.documented: true,
+                    this.platforms: DART2JS_PLATFORM | VM_PLATFORM});
 
   bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0;
   bool get isVmLibrary => (platforms & VM_PLATFORM) != 0;
diff --git a/lib/compiler/implementation/apiimpl.dart b/lib/compiler/implementation/apiimpl.dart
index d65f8c7..8bcd5ca 100644
--- a/lib/compiler/implementation/apiimpl.dart
+++ b/lib/compiler/implementation/apiimpl.dart
@@ -2,17 +2,17 @@
 // 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('leg_apiimpl');
+library leg_apiimpl;
 
-#import('dart:uri');
+import 'dart:uri';
 
-#import('../compiler.dart', prefix: 'api');
-#import('leg.dart', prefix: 'leg');
-#import('tree/tree.dart', prefix: 'tree');
-#import('elements/elements.dart', prefix: 'elements');
-#import('ssa/tracer.dart', prefix: 'ssa');
-#import('../../../lib/_internal/libraries.dart');
-#import('source_file.dart');
+import '../compiler.dart' as api;
+import 'dart2jslib.dart' as leg;
+import 'tree/tree.dart' as tree;
+import 'elements/elements.dart' as elements;
+import 'ssa/tracer.dart' as ssa;
+import '../../../lib/_internal/libraries.dart';
+import 'source_file.dart';
 
 class Compiler extends leg.Compiler {
   api.ReadStringFromUri provider;
@@ -31,6 +31,7 @@
             enableUserAssertions: hasOption(options, '--enable-checked-mode'),
             enableMinification: hasOption(options, '--minify'),
             emitJavaScript: !hasOption(options, '--output-type=dart'),
+            disallowUnsafeEval: hasOption(options, '--disallow-unsafe-eval'),
             strips: getStrips(options),
             enableConcreteTypeInference:
               hasOption(options, '--enable-concrete-type-inference'));
@@ -50,10 +51,10 @@
 
   String lookupLibraryPath(String dartLibraryName) {
     LibraryInfo info = LIBRARIES[dartLibraryName];
-    if (info === null) return null;
+    if (info == null) return null;
     if (!info.isDart2jsLibrary) return null;
     String path = info.dart2jsPath;
-    if (path === null) {
+    if (path == null) {
       path = info.path;
     }
     return "lib/$path";
@@ -61,10 +62,10 @@
 
   String lookupPatchPath(String dartLibraryName) {
     LibraryInfo info = LIBRARIES[dartLibraryName];
-    if (info === null) return null;
+    if (info == null) return null;
     if (!info.isDart2jsLibrary) return null;
     String path = info.dart2jsPatchPath;
-    if (path === null) return null;
+    if (path == null) return null;
     return "lib/$path";
   }
 
@@ -92,7 +93,7 @@
       // directly. In effect, we don't support truly asynchronous API.
       text = provider(translated).value;
     } catch (exception) {
-      if (node !== null) {
+      if (node != null) {
         cancel("$exception", node: node);
       } else {
         reportDiagnostic(null, "$exception", api.Diagnostic.ERROR);
@@ -112,7 +113,7 @@
 
   Uri translateDartUri(Uri uri, tree.Node node) {
     String path = lookupLibraryPath(uri.path);
-    if (path === null || LIBRARIES[uri.path].category == "Internal") {
+    if (path == null || LIBRARIES[uri.path].category == "Internal") {
       if (node != null) {
         reportError(node, 'library not found ${uri}');
       } else {
@@ -132,7 +133,7 @@
 
   Uri resolvePatchUri(String dartLibraryPath) {
     String patchPath = lookupPatchPath(dartLibraryPath);
-    if (patchPath === null) return null;
+    if (patchPath == null) return null;
     return libraryRoot.resolve(patchPath);
   }
 
@@ -148,12 +149,13 @@
 
   void reportDiagnostic(leg.SourceSpan span, String message,
                         api.Diagnostic kind) {
-    if (kind === api.Diagnostic.ERROR || kind === api.Diagnostic.CRASH) {
+    if (identical(kind, api.Diagnostic.ERROR)
+        || identical(kind, api.Diagnostic.CRASH)) {
       compilationFailed = true;
     }
     // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
     // instance in the [Types] constructor in typechecker.dart.
-    if (span === null || span.uri === null) {
+    if (span == null || span.uri == null) {
       handler(null, null, null, message, kind);
     } else {
       handler(translateUri(span.uri, null), span.begin, span.end,
@@ -163,6 +165,6 @@
 
   bool get isMockCompilation {
     return mockableLibraryUsed
-      && (options.indexOf('--allow-mock-compilation') !== -1);
+      && (options.indexOf('--allow-mock-compilation') != -1);
   }
 }
diff --git a/lib/compiler/implementation/closure.dart b/lib/compiler/implementation/closure.dart
index be78e41..090a8e9 100644
--- a/lib/compiler/implementation/closure.dart
+++ b/lib/compiler/implementation/closure.dart
@@ -2,13 +2,12 @@
 // 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("closureToClassMapper");
+library closureToClassMapper;
 
-#import("elements/elements.dart");
-#import("leg.dart");
-#import("scanner/scannerlib.dart");
-#import("tree/tree.dart");
-#import("util/util.dart");
+import "elements/elements.dart";
+import "dart2jslib.dart";
+import "tree/tree.dart";
+import "util/util.dart";
 
 class ClosureTask extends CompilerTask {
   Map<Node, ClosureClassMap> closureMappingCache;
@@ -23,7 +22,7 @@
                                                TreeElements elements) {
     return measure(() {
       ClosureClassMap cached = closureMappingCache[node];
-      if (cached !== null) return cached;
+      if (cached != null) return cached;
 
       ClosureTranslator translator =
           new ClosureTranslator(compiler, elements, closureMappingCache);
@@ -45,7 +44,7 @@
   ClosureClassMap getMappingForNestedFunction(FunctionExpression node) {
     return measure(() {
       ClosureClassMap nestedClosureData = closureMappingCache[node];
-      if (nestedClosureData === null) {
+      if (nestedClosureData == null) {
         // TODO(floitsch): we can only assume that the reason for not having a
         // closure data here is, because the function is inside an initializer.
         compiler.unimplemented("Closures inside initializers", node: node);
@@ -163,7 +162,7 @@
         this.usedVariablesInTry = new Set<Element>(),
         this.parametersWithSentinel = new Map<Element, Element>();
 
-  bool isClosure() => closureElement !== null;
+  bool isClosure() => closureElement != null;
 }
 
 class ClosureTranslator extends Visitor {
@@ -235,7 +234,7 @@
       freeVariableMapping.getKeys().forEach((Element fromElement) {
         assert(fromElement == freeVariableMapping[fromElement]);
         Element updatedElement = capturedVariableMapping[fromElement];
-        assert(updatedElement !== null);
+        assert(updatedElement != null);
         if (fromElement == updatedElement) {
           assert(freeVariableMapping[fromElement] == updatedElement);
           assert(Elements.isLocal(updatedElement)
@@ -307,7 +306,7 @@
          link = link.tail) {
       Node definition = link.head;
       Element element = elements[definition];
-      assert(element !== null);
+      assert(element != null);
       declareLocal(element);
       // We still need to visit the right-hand sides of the init-assignments.
       // For SendSets don't visit the left again. Otherwise it would be marked
@@ -335,7 +334,7 @@
     Element element = elements[node];
     if (Elements.isLocal(element)) {
       useLocal(element);
-    } else if (node.receiver === null &&
+    } else if (node.receiver == null &&
                Elements.isInstanceSend(node, elements)) {
       useLocal(closureData.thisElement);
     } else if (node.isSuperCall) {
@@ -463,11 +462,11 @@
   visitFor(For node) {
     visitLoop(node);
     // See if we have declared loop variables that need to be boxed.
-    if (node.initializer === null) return;
+    if (node.initializer == null) return;
     VariableDefinitions definitions = node.initializer.asVariableDefinitions();
     if (definitions == null) return;
     ClosureScope scopeData = closureData.capturingScopes[node];
-    if (scopeData === null) return;
+    if (scopeData == null) return;
     List<Element> result = <Element>[];
     for (Link<Node> link = definitions.definitions.nodes;
          !link.isEmpty();
@@ -492,11 +491,11 @@
     }
     for (Element enclosingElement = element.enclosingElement;
          enclosingElement != null &&
-             (enclosingElement.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY
-              || enclosingElement.kind === ElementKind.CLASS
-              || enclosingElement.kind === ElementKind.FUNCTION
-              || enclosingElement.kind === ElementKind.GETTER
-              || enclosingElement.kind === ElementKind.SETTER);
+             (identical(enclosingElement.kind, ElementKind.GENERATIVE_CONSTRUCTOR_BODY)
+              || identical(enclosingElement.kind, ElementKind.CLASS)
+              || identical(enclosingElement.kind, ElementKind.FUNCTION)
+              || identical(enclosingElement.kind, ElementKind.GETTER)
+              || identical(enclosingElement.kind, ElementKind.SETTER));
          enclosingElement = enclosingElement.enclosingElement) {
       SourceString surroundingName = enclosingElement.name;
       if (surroundingName != null) {
@@ -552,7 +551,7 @@
 
     inNewScope(node, () {
       // We have to declare the implicit 'this' parameter.
-      if (!insideClosure && closureData.thisElement !== null) {
+      if (!insideClosure && closureData.thisElement != null) {
         declareLocal(closureData.thisElement);
       }
       // If we are inside a named closure we have to declare ourselve. For
@@ -614,8 +613,8 @@
       // parameters, etc. Other phases should only visit statements.
       // TODO(floitsch): we avoid visiting the initializers on purpose so that
       // we get an error-message later in the builder.
-      if (node.parameters !== null) node.parameters.accept(this);
-      if (node.body !== null) node.body.accept(this);
+      if (node.parameters != null) node.parameters.accept(this);
+      if (node.body != null) node.body.accept(this);
     });
   }
 
diff --git a/lib/compiler/implementation/compile_time_constants.dart b/lib/compiler/implementation/compile_time_constants.dart
index 0f3fd37..aa6a7a5 100644
--- a/lib/compiler/implementation/compile_time_constants.dart
+++ b/lib/compiler/implementation/compile_time_constants.dart
@@ -75,7 +75,7 @@
    * Returns the a compile-time constant if the variable could be compiled
    * eagerly. Otherwise returns `null`.
    */
-  Constant compileVariable(VariableElement element, [bool isConst = false]) {
+  Constant compileVariable(VariableElement element, {bool isConst: false}) {
     return measure(() {
       if (initialVariableValues.containsKey(element)) {
         Constant result = initialVariableValues[element];
@@ -96,7 +96,7 @@
    */
   Constant compileVariableWithDefinitions(VariableElement element,
                                           TreeElements definitions,
-                                          [bool isConst = false]) {
+                                          {bool isConst: false}) {
     return measure(() {
       // Initializers for parameters must be const.
       isConst = isConst || element.modifiers.isConst()
@@ -118,7 +118,7 @@
 
       SendSet assignment = node.asSendSet();
       Constant value;
-      if (assignment === null) {
+      if (assignment == null) {
         // No initial value.
         value = new NullConstant();
       } else {
@@ -156,11 +156,11 @@
 
   Constant compileNodeWithDefinitions(Node node,
                                       TreeElements definitions,
-                                      [bool isConst]) {
+                                      {bool isConst}) {
     return measure(() {
-      assert(node !== null);
+      assert(node != null);
       CompileTimeConstantEvaluator evaluator = new CompileTimeConstantEvaluator(
-          constantSystem, definitions, compiler, isConst);
+          constantSystem, definitions, compiler, isConst: isConst);
       return evaluator.evaluate(node);
     });
   }
@@ -168,7 +168,7 @@
   /** Attempts to compile a constant expression. Returns null if not possible */
   Constant tryCompileNodeWithDefinitions(Node node, TreeElements definitions) {
     return measure(() {
-      assert(node !== null);
+      assert(node != null);
       try {
         TryCompileTimeConstantEvaluator evaluator =
             new TryCompileTimeConstantEvaluator(constantSystem,
@@ -231,7 +231,7 @@
 
   Constant getInitialValueFor(VariableElement element) {
     Constant initialValue = initialVariableValues[element];
-    if (initialValue === null) {
+    if (initialValue == null) {
       compiler.internalError("No initial value for given element",
                              element: element);
     }
@@ -248,7 +248,7 @@
   CompileTimeConstantEvaluator(this.constantSystem,
                                this.elements,
                                this.compiler,
-                               [bool isConst])
+                               {bool isConst})
       : this.isEvaluatingConstant = isConst;
 
   Constant evaluate(Node node) {
@@ -309,7 +309,7 @@
          link = link.tail) {
       LiteralMapEntry entry = link.head;
       Constant key = evaluateConstant(entry.key);
-      if (!key.isString() || entry.key.asStringNode() === null) {
+      if (!key.isString() || entry.key.asStringNode() == null) {
         MessageKind kind = MessageKind.KEY_NOT_A_STRING_LITERAL;
         compiler.reportError(entry.key, new ResolutionError(kind, const []));
       }
@@ -326,7 +326,7 @@
         values.add(map[key]);
       }
     }
-    bool hasProtoKey = (protoValue !== null);
+    bool hasProtoKey = (protoValue != null);
     // TODO(floitsch): this should be a List<String> type.
     DartType keysType = new InterfaceType(compiler.listClass);
     ListConstant keysList = new ListConstant(keysType, keys);
@@ -367,7 +367,7 @@
     for (StringInterpolationPart part in node.parts) {
       Constant expression = evaluate(part.expression);
       DartString expressionString;
-      if (expression === null) {
+      if (expression == null) {
         return signalNotCompileTimeConstant(part.expression);
       } else if (expression.isNum() || expression.isBool()) {
         PrimitiveConstant primitive = expression;
@@ -403,15 +403,16 @@
         } else if (element.modifiers.isFinal() && !isEvaluatingConstant) {
           result = compiler.compileVariable(element);
         }
-        if (result !== null) return result;
+        if (result != null) return result;
       }
       return signalNotCompileTimeConstant(send);
     } else if (send.isCall) {
-      if (element === compiler.identicalFunction && send.argumentCount() == 2) {
+      if (identical(element, compiler.identicalFunction)
+          && send.argumentCount() == 2) {
         Constant left = evaluate(send.argumentsNode.nodes.head);
         Constant right = evaluate(send.argumentsNode.nodes.tail.head);
         Constant result = constantSystem.identity.fold(left, right);
-        if (result !== null) return result;
+        if (result != null) return result;
       }
       return signalNotCompileTimeConstant(send);
     } else if (send.isPrefix) {
@@ -434,7 +435,7 @@
           compiler.internalError("Unexpected operator.", node: op);
           break;
       }
-      if (folded === null) return signalNotCompileTimeConstant(send);
+      if (folded == null) return signalNotCompileTimeConstant(send);
       return folded;
     } else if (send.isOperator && !send.isPostfix) {
       assert(send.argumentCount() == 1);
@@ -506,7 +507,7 @@
         case "!=":
           if (left.isPrimitive() && right.isPrimitive()) {
             BoolConstant areEquals = constantSystem.equal.fold(left, right);
-            if (areEquals === null) {
+            if (areEquals == null) {
               folded = null;
             } else {
               folded = areEquals.negate();
@@ -516,14 +517,14 @@
         case "!==":
           BoolConstant areIdentical =
               constantSystem.identity.fold(left, right);
-          if (areIdentical === null) {
+          if (areIdentical == null) {
             folded = null;
           } else {
             folded = areIdentical.negate();
           }
           break;
       }
-      if (folded === null) return signalNotCompileTimeConstant(send);
+      if (folded == null) return signalNotCompileTimeConstant(send);
       return folded;
     }
     return signalNotCompileTimeConstant(send);
@@ -660,7 +661,7 @@
     Element element = elements[send];
     if (Elements.isLocal(element)) {
       Constant constant = definitions[element];
-      if (constant === null) {
+      if (constant == null) {
         compiler.internalError("Local variable without value", node: send);
       }
       return constant;
@@ -734,7 +735,7 @@
 
     bool foundSuperOrRedirect = false;
 
-    if (initializerList !== null) {
+    if (initializerList != null) {
       for (Link<Node> link = initializerList.nodes;
            !link.isEmpty();
            link = link.tail) {
@@ -765,7 +766,7 @@
       ClassElement enclosingClass = constructor.getEnclosingClass();
       ClassElement superClass = enclosingClass.superclass;
       if (enclosingClass != compiler.objectClass) {
-        assert(superClass !== null);
+        assert(superClass != null);
         assert(superClass.resolutionState == STATE_DONE);
 
         Selector selector =
@@ -773,7 +774,7 @@
 
         FunctionElement targetConstructor =
             superClass.lookupConstructor(selector);
-        if (targetConstructor === null) {
+        if (targetConstructor == null) {
           compiler.internalError("no default constructor available",
                                  node: functionNode);
         }
@@ -801,16 +802,16 @@
   List<Constant> buildJsNewArguments(ClassElement classElement) {
     List<Constant> jsNewArguments = <Constant>[];
     classElement.implementation.forEachInstanceField(
+        (ClassElement enclosing, Element field) {
+          Constant fieldValue = fieldValues[field];
+          if (fieldValue === null) {
+            // Use the default value.
+            fieldValue = compiler.compileConstant(field);
+          }
+          jsNewArguments.add(fieldValue);
+        },
         includeBackendMembers: true,
-        includeSuperMembers: true,
-        f: (ClassElement enclosing, Element field) {
-      Constant fieldValue = fieldValues[field];
-      if (fieldValue === null) {
-        // Use the default value.
-        fieldValue = compiler.compileConstant(field);
-      }
-      jsNewArguments.add(fieldValue);
-    });
+        includeSuperMembers: true);
     return jsNewArguments;
   }
 }
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index c15a3ed..6245eab 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -47,11 +47,11 @@
     assert(invariant(element, element.isDeclaration));
   }
 
-  bool isAnalyzed() => resolutionTree !== null;
+  bool isAnalyzed() => resolutionTree != null;
 
   void run(Compiler compiler, Enqueuer world) {
     CodeBuffer codeBuffer = world.universe.generatedCode[element];
-    if (codeBuffer !== null) return;
+    if (codeBuffer != null) return;
     resolutionTree = compiler.analyze(this, world);
     compiler.codegen(this, world);
   }
@@ -130,6 +130,7 @@
   ClassElement functionClass;
   ClassElement nullClass;
   ClassElement listClass;
+  ClassElement mapClass;
   Element assertMethod;
   Element identicalFunction;
   Element functionApplyMethod;
@@ -194,14 +195,15 @@
 
   bool hasCrashed = false;
 
-  Compiler([this.tracer = const Tracer(),
-            this.enableTypeAssertions = false,
-            this.enableUserAssertions = false,
-            this.enableConcreteTypeInference = false,
-            this.enableMinification = false,
-            bool emitJavaScript = true,
-            bool generateSourceMap = true,
-            List<String> strips = const []])
+  Compiler({this.tracer: const Tracer(),
+            this.enableTypeAssertions: false,
+            this.enableUserAssertions: false,
+            this.enableConcreteTypeInference: false,
+            this.enableMinification: false,
+            bool emitJavaScript: true,
+            bool generateSourceMap: true,
+            bool disallowUnsafeEval: false,
+            List<String> strips: const []})
       : libraries = new Map<String, LibraryElement>(),
         progress = new Stopwatch() {
     progress.start();
@@ -217,7 +219,9 @@
     checker = new TypeCheckerTask(this);
     typesTask = new ti.TypesTask(this, enableConcreteTypeInference);
     backend = emitJavaScript ?
-        new js_backend.JavaScriptBackend(this, generateSourceMap) :
+        new js_backend.JavaScriptBackend(this,
+                                         generateSourceMap,
+                                         disallowUnsafeEval) :
         new dart_backend.DartBackend(this, strips);
     constantHandler = new ConstantHandler(this, backend.constantSystem);
     enqueuer = new EnqueueTask(this);
@@ -236,16 +240,19 @@
   }
 
   void unimplemented(String methodName,
-                     [Node node, Token token, HInstruction instruction,
-                      Element element]) {
+                     {Node node, Token token, HInstruction instruction,
+                      Element element}) {
     internalError("$methodName not implemented",
-                  node, token, instruction, element);
+                  node: node, token: token,
+                  instruction: instruction, element: element);
   }
 
   void internalError(String message,
-                     [Node node, Token token, HInstruction instruction,
-                      Element element]) {
-    cancel('Internal error: $message', node, token, instruction, element);
+                     {Node node, Token token, HInstruction instruction,
+                      Element element}) {
+    cancel('Internal error: $message',
+           node: node, token: token,
+           instruction: instruction, element: element);
   }
 
   void internalErrorOnElement(Element element, String message) {
@@ -261,18 +268,18 @@
     print(MessageKind.PLEASE_REPORT_THE_CRASH.message([BUILD_ID]));
   }
 
-  void cancel([String reason, Node node, Token token,
-               HInstruction instruction, Element element]) {
+  void cancel(String reason, {Node node, Token token,
+               HInstruction instruction, Element element}) {
     assembledCode = null; // Compilation failed. Make sure that we
                           // don't return a bogus result.
     SourceSpan span = null;
-    if (node !== null) {
+    if (node != null) {
       span = spanFromNode(node);
-    } else if (token !== null) {
+    } else if (token != null) {
       span = spanFromTokens(token, token);
-    } else if (instruction !== null) {
+    } else if (instruction != null) {
       span = spanFromElement(currentElement);
-    } else if (element !== null) {
+    } else if (element != null) {
       span = spanFromElement(element);
     } else {
       throw 'No error location for error: $reason';
@@ -282,9 +289,10 @@
   }
 
   void reportFatalError(String reason, Element element,
-                        [Node node, Token token, HInstruction instruction]) {
+                        {Node node, Token token, HInstruction instruction}) {
     withCurrentElement(element, () {
-      cancel(reason, node, token, instruction, element);
+      cancel(reason, node: node, token: token, instruction: instruction,
+             element: element);
     });
   }
 
@@ -308,7 +316,7 @@
   void enableNoSuchMethod(Element element) {
     // TODO(ahe): Move this method to Enqueuer.
     if (enabledNoSuchMethod) return;
-    if (element.getEnclosingClass() === objectClass) {
+    if (identical(element.getEnclosingClass(), objectClass)) {
       enqueuer.resolution.registerDynamicInvocationOf(element);
       return;
     }
@@ -329,14 +337,14 @@
     enqueuer.codegen.addToWorkList(isolateLibrary.find(START_ROOT_ISOLATE));
   }
 
-  bool hasIsolateSupport() => isolateLibrary !== null;
+  bool hasIsolateSupport() => isolateLibrary != null;
 
   /**
    * This method is called before [library] import and export scopes have been
    * set up.
    */
   void onLibraryScanned(LibraryElement library, Uri uri) {
-    if (dynamicClass !== null) {
+    if (dynamicClass != null) {
       // When loading the built-in libraries, dynamicClass is null. We
       // take advantage of this as core and coreimpl import js_helper
       // and see Dynamic this way.
@@ -352,7 +360,7 @@
     bool coreLibValid = true;
     ClassElement lookupSpecialClass(SourceString name) {
       ClassElement result = coreLibrary.find(name);
-      if (result === null) {
+      if (result == null) {
         log('core library class $name missing');
         coreLibValid = false;
       }
@@ -366,6 +374,7 @@
     stringClass = lookupSpecialClass(const SourceString('String'));
     functionClass = lookupSpecialClass(const SourceString('Function'));
     listClass = lookupSpecialClass(const SourceString('List'));
+    mapClass = lookupSpecialClass(const SourceString('Map'));
     closureClass = lookupSpecialClass(const SourceString('Closure'));
     dynamicClass = lookupSpecialClass(const SourceString('Dynamic_'));
     nullClass = lookupSpecialClass(const SourceString('Null'));
@@ -406,7 +415,7 @@
   }
 
   void importHelperLibrary(LibraryElement library) {
-    if (jsHelperLibrary !== null) {
+    if (jsHelperLibrary != null) {
       libraryLoader.importLibrary(library, jsHelperLibrary, null);
     }
   }
@@ -443,12 +452,13 @@
         || libraryName == 'dart:math'
         || libraryName == 'dart:html') {
       if (libraryName == 'dart:html') {
+        // dart:html needs access to convertDartClosureToJS.
         importHelperLibrary(library);
       }
       library.addToScope(findHelper(const SourceString('JS')), this);
       Element jsIndexingBehaviorInterface =
           findHelper(const SourceString('JavaScriptIndexingBehavior'));
-      if (jsIndexingBehaviorInterface !== null) {
+      if (jsIndexingBehaviorInterface != null) {
         library.addToScope(jsIndexingBehaviorInterface, this);
       }
     }
@@ -462,7 +472,7 @@
       maybeEnableJSHelper(library);
     });
     final Element main = mainApp.find(MAIN);
-    if (main === null) {
+    if (main == null) {
       reportFatalError('Could not find $MAIN', mainApp);
     } else {
       if (!main.isFunction()) reportFatalError('main is not a function', main);
@@ -536,10 +546,10 @@
           e.isField() ||
           e.isTypeVariable() ||
           e.isTypedef() ||
-          e.kind === ElementKind.ABSTRACT_FIELD) {
+          identical(e.kind, ElementKind.ABSTRACT_FIELD)) {
         resolved.remove(e);
       }
-      if (e.kind === ElementKind.GENERATIVE_CONSTRUCTOR) {
+      if (identical(e.kind, ElementKind.GENERATIVE_CONSTRUCTOR)) {
         ClassElement enclosingClass = e.getEnclosingClass();
         if (enclosingClass.isInterface()) {
           resolved.remove(e);
@@ -547,10 +557,10 @@
         resolved.remove(e);
 
       }
-      if (e.getLibrary() === jsHelperLibrary) {
+      if (identical(e.getLibrary(), jsHelperLibrary)) {
         resolved.remove(e);
       }
-      if (e.getLibrary() === interceptorsLibrary) {
+      if (identical(e.getLibrary(), interceptorsLibrary)) {
         resolved.remove(e);
       }
     }
@@ -566,16 +576,16 @@
   TreeElements analyzeElement(Element element) {
     assert(invariant(element, element.isDeclaration));
     TreeElements elements = enqueuer.resolution.getCachedElements(element);
-    if (elements !== null) return elements;
+    if (elements != null) return elements;
     final int allowed = ElementCategory.VARIABLE | ElementCategory.FUNCTION
                         | ElementCategory.FACTORY;
     ElementKind kind = element.kind;
     if (!element.isAccessor() &&
-        ((kind === ElementKind.ABSTRACT_FIELD) ||
+        ((identical(kind, ElementKind.ABSTRACT_FIELD)) ||
          (kind.category & allowed) == 0)) {
       return null;
     }
-    assert(parser !== null);
+    assert(parser != null);
     Node tree = parser.parse(element);
     validator.validate(tree);
     elements = resolver.resolve(element);
@@ -602,8 +612,8 @@
     }
     Element element = work.element;
     TreeElements result = world.getCachedElements(element);
-    if (result !== null) return result;
-    if (world !== enqueuer.resolution) {
+    if (result != null) return result;
+    if (!identical(world, enqueuer.resolution)) {
       internalErrorOnElement(element,
                              'Internal error: unresolved element: $element.');
     }
@@ -614,7 +624,7 @@
   }
 
   void codegen(WorkItem work, Enqueuer world) {
-    if (world !== enqueuer.codegen) return null;
+    if (!identical(world, enqueuer.codegen)) return null;
     if (progress.elapsedInMs() > 500) {
       // TODO(ahe): Add structured diagnostics to the compiler API and
       // use it to separate this from the --verbose option.
@@ -658,7 +668,7 @@
 
   bool isLazilyInitialized(VariableElement element) {
     Constant initialValue = compileVariable(element);
-    return initialValue === null;
+    return initialValue == null;
   }
 
   /**
@@ -681,11 +691,11 @@
     if (message is TypeWarning) {
       // TODO(ahe): Don't supress these warning when the type checker
       // is more complete.
-      if (message.message.kind === MessageKind.NOT_ASSIGNABLE) return;
-      if (message.message.kind === MessageKind.MISSING_RETURN) return;
-      if (message.message.kind === MessageKind.MAYBE_MISSING_RETURN) return;
-      if (message.message.kind === MessageKind.ADDITIONAL_ARGUMENT) return;
-      if (message.message.kind === MessageKind.METHOD_NOT_FOUND) return;
+      if (identical(message.message.kind, MessageKind.NOT_ASSIGNABLE)) return;
+      if (identical(message.message.kind, MessageKind.MISSING_RETURN)) return;
+      if (identical(message.message.kind, MessageKind.MAYBE_MISSING_RETURN)) return;
+      if (identical(message.message.kind, MessageKind.ADDITIONAL_ARGUMENT)) return;
+      if (identical(message.message.kind, MessageKind.METHOD_NOT_FOUND)) return;
     }
     SourceSpan span = spanFromNode(node);
 
@@ -708,13 +718,13 @@
                                  api.Diagnostic kind);
 
   SourceSpan spanFromTokens(Token begin, Token end, [Uri uri]) {
-    if (begin === null || end === null) {
+    if (begin == null || end == null) {
       // TODO(ahe): We can almost always do better. Often it is only
       // end that is null. Otherwise, we probably know the current
       // URI.
       throw 'Cannot find tokens to produce error message.';
     }
-    if (uri === null && currentElement !== null) {
+    if (uri == null && currentElement != null) {
       uri = currentElement.getCompilationUnit().script.uri;
     }
     return SourceSpan.withCharacterOffsets(begin, end,
@@ -729,7 +739,7 @@
     if (Elements.isErroneousElement(element)) {
       element = element.enclosingElement;
     }
-    if (element.position() === null) {
+    if (element.position() == null) {
       // Sometimes, the backend fakes up elements that have no
       // position. So we use the enclosing element instead. It is
       // not a good error location, but cancel really is "internal
@@ -738,12 +748,12 @@
       element = element.enclosingElement;
       // TODO(ahe): I plan to overhaul this infrastructure anyways.
     }
-    if (element === null) {
+    if (element == null) {
       element = currentElement;
     }
     Token position = element.position();
     Uri uri = element.getCompilationUnit().script.uri;
-    return (position === null)
+    return (position == null)
         ? new SourceSpan(uri, 0, 0)
         : spanFromTokens(position, position, uri);
   }
@@ -779,11 +789,11 @@
     // TODO(kasperl): Do we have to worry about exceptions here?
     CompilerTask previous = compiler.measuredTask;
     compiler.measuredTask = this;
-    if (previous !== null) previous.watch.stop();
+    if (previous != null) previous.watch.stop();
     watch.start();
     var result = action();
     watch.stop();
-    if (previous !== null) previous.watch.start();
+    if (previous != null) previous.watch.start();
     compiler.measuredTask = previous;
     return result;
   }
@@ -795,7 +805,7 @@
 
   String toString() {
     String banner = 'compiler cancelled';
-    return (reason !== null) ? '$banner: $reason' : '$banner';
+    return (reason != null) ? '$banner: $reason' : '$banner';
   }
 }
 
diff --git a/lib/compiler/implementation/constant_system_dart.dart b/lib/compiler/implementation/constant_system_dart.dart
index 520d78d..ee38d71 100644
--- a/lib/compiler/implementation/constant_system_dart.dart
+++ b/lib/compiler/implementation/constant_system_dart.dart
@@ -61,7 +61,7 @@
       IntConstant leftInt = left;
       IntConstant rightInt = right;
       int resultValue = foldInts(leftInt.value, rightInt.value);
-      if (resultValue === null) return null;
+      if (resultValue == null) return null;
       return DART_CONSTANT_SYSTEM.createInt(resultValue);
     }
     return null;
@@ -157,7 +157,7 @@
         foldedValue = foldNums(leftNum.value, rightNum.value);
       }
       // A division by 0 means that we might not have a folded value.
-      if (foldedValue === null) return null;
+      if (foldedValue == null) return null;
       if (left.isInt() && right.isInt() && !isDivide()) {
         assert(foldedValue is int);
         return DART_CONSTANT_SYSTEM.createInt(foldedValue);
@@ -317,7 +317,7 @@
     if (left.isNaN() && right.isNaN()) return null;
     return DART_CONSTANT_SYSTEM.createBool(left == right);
   }
-  apply(left, right) => left === right;
+  apply(left, right) => identical(left, right);
 }
 
 /**
diff --git a/lib/compiler/implementation/constants.dart b/lib/compiler/implementation/constants.dart
index c8625bb..5268e8b 100644
--- a/lib/compiler/implementation/constants.dart
+++ b/lib/compiler/implementation/constants.dart
@@ -72,7 +72,7 @@
 
   bool operator ==(var other) {
     if (other is !FunctionConstant) return false;
-    return other.element === element;
+    return identical(other.element, element);
   }
 
   String toString() => element.toString();
@@ -250,7 +250,7 @@
 
   FalseConstant negate() => new FalseConstant();
 
-  bool operator ==(var other) => this === other;
+  bool operator ==(var other) => identical(this, other);
   // The magic constant is just a random value. It does not have any
   // significance.
   int hashCode() => 499;
@@ -268,7 +268,7 @@
 
   TrueConstant negate() => new TrueConstant();
 
-  bool operator ==(var other) => this === other;
+  bool operator ==(var other) => identical(this, other);
   // The magic constant is just a random value. It does not have any
   // significance.
   int hashCode() => 536555975;
@@ -414,7 +414,7 @@
   int _hashCode;
 
   ConstructedConstant(DartType type, this.fields) : super(type) {
-    assert(type !== null);
+    assert(type != null);
     // TODO(floitsch): create a better hash.
     int hash = 0;
     for (Constant field in fields) {
diff --git a/lib/compiler/implementation/dart2js.dart b/lib/compiler/implementation/dart2js.dart
index 91e7b92..526652c 100644
--- a/lib/compiler/implementation/dart2js.dart
+++ b/lib/compiler/implementation/dart2js.dart
@@ -36,7 +36,7 @@
   // m[0] is the entire match (which will be equal to argument). m[1]
   // is something like "-o" or "--out=", and m[2] is the parameter.
   Match m = const RegExp('^(-[a-z]|--.+=)(.*)').firstMatch(argument);
-  if (m === null) helpAndFail('Error: Unknown option "$argument".');
+  if (m == null) helpAndFail('Error: Unknown option "$argument".');
   return m[2];
 }
 
@@ -56,7 +56,7 @@
     Match match = pattern.firstMatch(argument);
     assert(match.groupCount() == handlers.length);
     for (int i = 0; i < handlers.length; i++) {
-      if (match[i + 1] !== null) {
+      if (match[i + 1] != null) {
         handlers[i].handle(argument);
         continue OUTER;
       }
@@ -155,7 +155,8 @@
     new OptionHandler('--enable-concrete-type-inference',
                       (_) => passThrough('--enable-concrete-type-inference')),
     new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
-    new OptionHandler(r'--package-root=.+|-p.+', setPackageRoot),
+    new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
+    new OptionHandler('--disallow-unsafe-eval', passThrough),
     // The following two options must come last.
     new OptionHandler('-.*', (String argument) {
       helpAndFail('Error: Unknown option "$argument".');
@@ -201,7 +202,7 @@
   }
 
   void info(var message, [api.Diagnostic kind = api.Diagnostic.VERBOSE_INFO]) {
-    if (!verbose && kind === api.Diagnostic.VERBOSE_INFO) return;
+    if (!verbose && identical(kind, api.Diagnostic.VERBOSE_INFO)) return;
     if (enableColors) {
       print('${colors.green("info:")} $message');
     } else {
@@ -217,7 +218,7 @@
 
   void handler(Uri uri, int begin, int end, String message,
                api.Diagnostic kind) {
-    if (kind.name === 'source map') {
+    if (identical(kind.name, 'source map')) {
       // TODO(podivilov): We should find a better way to return source maps from
       // emitter. Using diagnostic handler for that purpose is a temporary hack.
       writeString(sourceMapOut, message);
@@ -225,30 +226,30 @@
     }
 
     if (isAborting) return;
-    isAborting = kind === api.Diagnostic.CRASH;
+    isAborting = identical(kind, api.Diagnostic.CRASH);
     bool fatal = (kind.ordinal & FATAL) != 0;
     bool isInfo = (kind.ordinal & INFO) != 0;
-    if (isInfo && uri === null && kind !== api.Diagnostic.INFO) {
+    if (isInfo && uri == null && !identical(kind, api.Diagnostic.INFO)) {
       info(message, kind);
       return;
     }
     var color;
     if (!enableColors) {
       color = (x) => x;
-    } else if (kind === api.Diagnostic.ERROR) {
+    } else if (identical(kind, api.Diagnostic.ERROR)) {
       color = colors.red;
-    } else if (kind === api.Diagnostic.WARNING) {
+    } else if (identical(kind, api.Diagnostic.WARNING)) {
       color = colors.magenta;
-    } else if (kind === api.Diagnostic.LINT) {
+    } else if (identical(kind, api.Diagnostic.LINT)) {
       color = colors.magenta;
-    } else if (kind === api.Diagnostic.CRASH) {
+    } else if (identical(kind, api.Diagnostic.CRASH)) {
       color = colors.red;
-    } else if (kind === api.Diagnostic.INFO) {
+    } else if (identical(kind, api.Diagnostic.INFO)) {
       color = colors.green;
     } else {
       throw 'Unknown kind: $kind (${kind.ordinal})';
     }
-    if (uri === null) {
+    if (uri == null) {
       assert(fatal);
       print(color(message));
     } else if (fatal || showWarnings) {
@@ -265,7 +266,7 @@
   }
 
   Uri uri = cwd.resolve(arguments[0]);
-  if (packageRoot === null) {
+  if (packageRoot == null) {
     packageRoot = uri.resolve('./packages/');
   }
 
@@ -275,7 +276,7 @@
   // directly. In effect, we don't support truly asynchronous API.
   String code = api.compile(uri, libraryRoot, packageRoot, provider, handler,
                             options).value;
-  if (code === null) {
+  if (code == null) {
     fail('Error: Compilation failed.');
   }
   String sourceMapFileName =
@@ -392,7 +393,13 @@
     libraries are used: dart:dom, dart:html dart:io.
 
   --enable-concrete-type-inference
-    Enable experimental concrete type inference.''');
+    Enable experimental concrete type inference.
+
+  --disallow-unsafe-eval
+    Disables dynamic generation of code in the generated output. This is
+    necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/).
+    This flag is not continuously tested. Please report breakages and we
+    will fix them as soon as possible.''');
 }
 
 void helpAndExit(bool verbose) {
diff --git a/lib/compiler/implementation/dart2jslib.dart b/lib/compiler/implementation/dart2jslib.dart
new file mode 100644
index 0000000..68369e5
--- /dev/null
+++ b/lib/compiler/implementation/dart2jslib.dart
@@ -0,0 +1,46 @@
+// Copyright (c) 2012, 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;
+
+import 'dart:uri';
+
+import 'closure.dart' as closureMapping;
+import 'dart_backend/dart_backend.dart' as dart_backend;
+import 'elements/elements.dart';
+import 'js_backend/js_backend.dart' as js_backend;
+import 'native_handler.dart' as native;
+import 'scanner/scanner_implementation.dart';
+import 'scanner/scannerlib.dart';
+import 'ssa/ssa.dart';
+import 'string_validator.dart';
+import 'source_file.dart';
+import 'tree/tree.dart';
+import 'universe/universe.dart';
+import 'util/characters.dart';
+import 'util/util.dart';
+import '../compiler.dart' as api;
+import 'patch_parser.dart';
+import 'types/types.dart' as ti;
+import 'resolution/resolution.dart';
+
+export 'resolution/resolution.dart' show TreeElements, TreeElementMapping;
+export 'scanner/scannerlib.dart' show SourceString, isUserDefinableOperator;
+export 'universe/universe.dart' show Selector;
+
+part 'code_buffer.dart';
+part 'compile_time_constants.dart';
+part 'compiler.dart';
+part 'constants.dart';
+part 'constant_system.dart';
+part 'constant_system_dart.dart';
+part 'diagnostic_listener.dart';
+part 'enqueue.dart';
+part 'library_loader.dart';
+part 'resolved_visitor.dart';
+part 'script.dart';
+part 'tree_validator.dart';
+part 'typechecker.dart';
+part 'warnings.dart';
+part 'world.dart';
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index a6d59d9..45eef3f 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -25,25 +25,25 @@
 
   Element operator[](Node node) {
     final result = super[node];
-    return result !== null ? result : getFirstNotNullResult((e) => e[node]);
+    return result != null ? result : getFirstNotNullResult((e) => e[node]);
   }
 
   Selector getSelector(Send send) {
     final result = super.getSelector(send);
-    return result !== null ?
+    return result != null ?
         result : getFirstNotNullResult((e) => e.getSelector(send));
   }
 
   DartType getType(TypeAnnotation annotation) {
     final result = super.getType(annotation);
-    return result !== null ?
+    return result != null ?
         result : getFirstNotNullResult((e) => e.getType(annotation));
   }
 
   getFirstNotNullResult(f(TreeElements element)) {
     for (final element in treeElements) {
       final result = f(element);
-      if (result !== null) return result;
+      if (result != null) return result;
     }
 
     return null;
@@ -72,9 +72,9 @@
       if (statement is EmptyStatement) return true;
       if (statement is ExpressionStatement) {
         Send send = statement.expression.asSend();
-        if (send !== null) {
+        if (send != null) {
           Element element = originalTreeElements[send];
-          if (stripAsserts && element === compiler.assertMethod) {
+          if (stripAsserts && identical(element, compiler.assertMethod)) {
             return true;
           }
         }
@@ -149,7 +149,7 @@
         assert(typeArgument is TypeAnnotation);
         DartType argumentType =
             compiler.resolveTypeAnnotation(classElement, typeArgument);
-        assert(argumentType !== null);
+        assert(argumentType != null);
         workQueue.add(argumentType);
       }
     }
@@ -165,7 +165,7 @@
         // Check class type args.
         processTypeArguments(element, node.typeParameters);
         // Check superclass type args.
-        if (node.superclass !== null) {
+        if (node.superclass != null) {
           NodeList typeArguments = node.superclass.typeArguments;
           processTypeArguments(element, node.superclass.typeArguments);
         }
@@ -175,7 +175,7 @@
               element, (interfaceNode as TypeAnnotation).typeArguments);
         }
         // Check all supertypes.
-        if (element.allSupertypes !== null) {
+        if (element.allSupertypes != null) {
           workQueue.addAll(element.allSupertypes.toList());
         }
       }
@@ -258,7 +258,7 @@
      * Object should not be in the resulting code.
      */
     bool shouldOutput(Element element) =>
-      element.kind !== ElementKind.VOID &&
+      !identical(element.kind, ElementKind.VOID) &&
       isUserLibrary(element.getLibrary()) &&
       element is !SynthesizedConstructorElement &&
       element is !AbstractFieldElement;
@@ -354,11 +354,11 @@
           compiler.types.voidType, const Link<DartType>(),
           constructor);
       constructor.cachedNode = new FunctionExpression(
-          new Send(receiver: classElement.parseNode(compiler).name,
-                   selector: synthesizedIdentifier),
-          new NodeList(beginToken: new StringToken(OPEN_PAREN_INFO, '(', -1),
-                       endToken: new StringToken(CLOSE_PAREN_INFO, ')', -1),
-                       nodes: const Link<Node>()),
+          new Send(classElement.parseNode(compiler).name,
+                   synthesizedIdentifier),
+          new NodeList(new StringToken(OPEN_PAREN_INFO, '(', -1),
+                       const Link<Node>(),
+                       new StringToken(CLOSE_PAREN_INFO, ')', -1)),
           new EmptyStatement(new StringToken(SEMICOLON_INFO, ';', -1)),
           null, Modifiers.EMPTY, null, null);
 
@@ -462,17 +462,17 @@
   EmitterUnparser(this.renames);
 
   visit(Node node) {
-    if (node !== null && renames.containsKey(node)) {
+    if (node != null && renames.containsKey(node)) {
       sb.add(renames[node]);
     } else {
       super.visit(node);
     }
   }
 
-  unparseSendReceiver(Send node, [bool spacesNeeded=false]) {
+  unparseSendReceiver(Send node, {bool spacesNeeded: false}) {
     // TODO(smok): Remove ugly hack for library prefices.
-    if (node.receiver !== null && renames[node.receiver] == '') return;
-    super.unparseSendReceiver(node, spacesNeeded);
+    if (node.receiver != null && renames[node.receiver] == '') return;
+    super.unparseSendReceiver(node, spacesNeeded: spacesNeeded);
   }
 }
 
@@ -501,7 +501,7 @@
     super.visitClassNode(node);
     // Temporary hack which should go away once interfaces
     // and default clauses are out.
-    if (node.defaultClause !== null) {
+    if (node.defaultClause != null) {
       // Resolver cannot resolve parameterized default clauses.
       TypeAnnotation evilCousine = new TypeAnnotation(
           node.defaultClause.typeName, null);
diff --git a/lib/compiler/implementation/dart_backend/dart_backend.dart b/lib/compiler/implementation/dart_backend/dart_backend.dart
index 4e66488..26b59d6 100644
--- a/lib/compiler/implementation/dart_backend/dart_backend.dart
+++ b/lib/compiler/implementation/dart_backend/dart_backend.dart
@@ -2,17 +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.
 
-#library('dart_backend');
+library dart_backend;
 
-#import('../elements/elements.dart');
-#import('../leg.dart');
-#import('../scanner/scannerlib.dart');
-#import('../tree/tree.dart');
-#import('../universe/universe.dart');
-#import('../util/util.dart');
+import '../elements/elements.dart';
+import '../dart2jslib.dart';
+import '../tree/tree.dart';
+import '../util/util.dart';
 
-#source('backend.dart');
-#source('emitter.dart');
-#source('renamer.dart');
-#source('placeholder_collector.dart');
-#source('utils.dart');
+import '../scanner/scannerlib.dart' show StringToken,
+                                         Keyword,
+                                         OPEN_PAREN_INFO,
+                                         CLOSE_PAREN_INFO,
+                                         SEMICOLON_INFO,
+                                         IDENTIFIER_INFO;
+
+part 'backend.dart';
+part 'emitter.dart';
+part 'renamer.dart';
+part 'placeholder_collector.dart';
+part 'utils.dart';
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 6e815c1..d4c8c41 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -44,14 +44,14 @@
 
   visitDynamicSend(Send node) {
     final element = elements[node];
-    if (element === null || !element.isErroneous()) {
+    if (element == null || !element.isErroneous()) {
       collector.tryMakeMemberPlaceholder(node.selector);
     }
   }
 
   visitClosureSend(Send node) {
     final element = elements[node];
-    if (element !== null) {
+    if (element != null) {
       collector.tryMakeLocalPlaceholder(element, node.selector);
     }
   }
@@ -59,7 +59,7 @@
   visitGetterSend(Send node) {
     final element = elements[node];
     // element === null means dynamic property access.
-    if (element === null) {
+    if (element == null) {
       collector.tryMakeMemberPlaceholder(node.selector);
     } else if (element.isErroneous()) {
       return;
@@ -86,7 +86,8 @@
 
   visitStaticSend(Send node) {
     final element = elements[node];
-    if (Elements.isUnresolved(element) || element === compiler.assertMethod) {
+    if (Elements.isUnresolved(element)
+        || identical(element, compiler.assertMethod)) {
       return;
     }
     if (element.isConstructor() || element.isFactoryConstructor()) {
@@ -108,11 +109,11 @@
           functionElement.functionSignature.optionalParameters;
       for (final argument in node.argumentsNode) {
         NamedArgument named = argument.asNamedArgument();
-        if (named === null) continue;
+        if (named == null) continue;
         Identifier name = named.name;
         String nameAsString = name.source.slowToString();
         for (final parameter in optionalParameters) {
-          if (parameter.kind === ElementKind.FIELD_PARAMETER) {
+          if (identical(parameter.kind, ElementKind.FIELD_PARAMETER)) {
             if (parameter.name.slowToString() == nameAsString) {
               collector.tryMakeMemberPlaceholder(name);
               break;
@@ -125,14 +126,14 @@
     collector.makeElementPlaceholder(node.selector, element);
     // Another ugly case: <lib prefix>.<top level> is represented as
     // receiver: lib prefix, selector: top level.
-    if (element.isTopLevel() && node.receiver !== null) {
+    if (element.isTopLevel() && node.receiver != null) {
       assert(elements[node.receiver].isPrefix());
       // Hack: putting null into map overrides receiver of original node.
       collector.makeNullPlaceholder(node.receiver);
     }
   }
 
-  internalError(String reason, [Node node]) {
+  internalError(String reason, {Node node}) {
     collector.internalError(reason, node);
   }
 }
@@ -206,8 +207,8 @@
       // interface I { I(); }
       // class C implements I { C(); }  don't rename this case.
       // OR I.named() inside C, rename first part.
-      if (element.defaultImplementation !== null
-          && element.defaultImplementation !== element) {
+      if (element.defaultImplementation != null
+          && !identical(element.defaultImplementation, element)) {
         FunctionElement implementingFactory = element.defaultImplementation;
         if (implementingFactory is !SynthesizedConstructorElement) {
           tryMakeConstructorNamePlaceholder(
@@ -252,7 +253,7 @@
       for (Node definition in definitions.definitions) {
         final definitionElement = treeElements[definition];
         // definitionElement === null if variable is actually unused.
-        if (definitionElement === null) continue;
+        if (definitionElement == null) continue;
         collectFieldDeclarationPlaceholders(definitionElement, definition);
       }
       makeVarDeclarationTypePlaceholder(definitions);
@@ -269,7 +270,7 @@
     bool isOptionalParameter() {
       FunctionElement function = element.enclosingElement;
       for (Element parameter in function.functionSignature.optionalParameters) {
-        if (parameter === element) return true;
+        if (identical(parameter, element)) return true;
       }
       return false;
     }
@@ -285,7 +286,7 @@
   }
 
   void tryMakeMemberPlaceholder(Identifier node) {
-    assert(node !== null);
+    assert(node != null);
     if (node.source.isPrivate()) return;
     if (node is Operator) return;
     final identifier = node.source.slowToString();
@@ -306,7 +307,7 @@
   }
 
   void makeOmitDeclarationTypePlaceholder(TypeAnnotation type) {
-    if (type === null) return;
+    if (type == null) return;
     declarationTypePlaceholders.add(
         new DeclarationTypePlaceholder(type, false));
   }
@@ -316,7 +317,7 @@
     // makeDeclaratioTypePlaceholder have type declaration placeholder
     // collector logic in visitVariableDefinitions when resolver becomes better
     // and/or catch syntax changes.
-    if (node.type === null) return;
+    if (node.type == null) return;
     Element definitionElement = treeElements[node.definitions.nodes.head];
     bool requiresVar = !node.modifiers.isFinalOrConst();
     declarationTypePlaceholders.add(
@@ -329,9 +330,9 @@
   }
 
   void makeElementPlaceholder(Identifier node, Element element) {
-    assert(element !== null);
-    if (element === entryFunction) return;
-    if (element.getLibrary() === coreLibrary) return;
+    assert(element != null);
+    if (identical(element, entryFunction)) return;
+    if (identical(element.getLibrary(), coreLibrary)) return;
     if (element.getLibrary().isPlatformLibrary && !element.isTopLevel()) {
       return;
     }
@@ -344,7 +345,7 @@
   }
 
   void makePrivateIdentifier(Identifier node) {
-    assert(node !== null);
+    assert(node != null);
     privateNodes.putIfAbsent(
         currentElement.getLibrary(), () => new Set<Identifier>()).add(node);
   }
@@ -366,13 +367,13 @@
     getLocalPlaceholder().nodes.add(identifier);
   }
 
-  void internalError(String reason, [Node node]) {
+  void internalError(String reason, {Node node}) {
     compiler.cancel(reason: reason, node: node);
   }
 
   void unreachable() { internalError('Unreachable case'); }
 
-  visit(Node node) => (node === null) ? null : node.accept(this);
+  visit(Node node) => (node == null) ? null : node.accept(this);
 
   visitNode(Node node) { node.visitChildren(this); }  // We must go deeper.
 
@@ -390,8 +391,8 @@
       // that is needed to rename the construct properly.
       element = treeElements[send.selector];
     }
-    if (element === null) {
-      if (send.receiver !== null) tryMakeMemberPlaceholder(send.selector);
+    if (element == null) {
+      if (send.receiver != null) tryMakeMemberPlaceholder(send.selector);
     } else if (!element.isErroneous()) {
       if (Elements.isStaticOrTopLevel(element)) {
         // TODO(smok): Worth investigating why sometimes we get getter/setter
@@ -417,8 +418,8 @@
 
   static bool isPlainTypeName(TypeAnnotation typeAnnotation) {
     if (typeAnnotation.typeName is !Identifier) return false;
-    if (typeAnnotation.typeArguments === null) return true;
-    if (typeAnnotation.typeArguments.length === 0) return true;
+    if (typeAnnotation.typeArguments == null) return true;
+    if (typeAnnotation.typeArguments.length == 0) return true;
     return false;
   }
 
@@ -438,7 +439,7 @@
     } else {
       typeDeclarationElement = currentElement.getEnclosingClass();
     }
-    if (typeDeclarationElement !== null && isPlainTypeName(node)
+    if (typeDeclarationElement != null && isPlainTypeName(node)
         && tryResolveAndCollectTypeVariable(
                typeDeclarationElement, node.typeName)) {
       return;
@@ -454,14 +455,14 @@
         Identifier selector = send.selector;
         Element potentialPrefix =
             currentElement.getLibrary().findLocal(receiver.source);
-        if (potentialPrefix !== null && potentialPrefix.isPrefix()) {
+        if (potentialPrefix != null && potentialPrefix.isPrefix()) {
           // prefix.Class case.
           hasPrefix = true;
         } else {
           // Class.namedContructor case.
           target = receiver;
           // If element is unresolved, mark namedConstructor as unresolved.
-          if (treeElements[node] === null) {
+          if (treeElements[node] == null) {
             makeUnresolvedPlaceholder(selector);
           }
         }
@@ -473,8 +474,8 @@
       Element typeElement = type.element;
       Element dynamicTypeElement = compiler.types.dynamicType.element;
       if (hasPrefix &&
-          (typeElement.getLibrary() === coreLibrary ||
-          typeElement === dynamicTypeElement)) {
+          (identical(typeElement.getLibrary(), coreLibrary) ||
+          identical(typeElement, dynamicTypeElement))) {
         makeNullPlaceholder(node.typeName.asSend().receiver);
       } else {
         if (hasPrefix) {
@@ -484,7 +485,7 @@
           assert(typeName.selector is Identifier);
           makeNullPlaceholder(typeName.receiver);
         }
-        if (typeElement !== dynamicTypeElement) {
+        if (!identical(typeElement, dynamicTypeElement)) {
           makeTypePlaceholder(target, type);
         } else {
           if (!isDynamicType(node)) makeUnresolvedPlaceholder(target);
@@ -511,19 +512,19 @@
       // of a function that is a parameter of another function.
       // TODO(smok): Fix this when resolver correctly deals with
       // such cases.
-      if (definitionElement === null) continue;
+      if (definitionElement == null) continue;
       if (definition is Send) {
         // May get FunctionExpression here in definition.selector
         // in case of A(int this.f());
         if (definition.selector is Identifier) {
-          if (definitionElement.kind === ElementKind.FIELD_PARAMETER) {
+          if (identical(definitionElement.kind, ElementKind.FIELD_PARAMETER)) {
             tryMakeMemberPlaceholder(definition.selector);
           } else {
             tryMakeLocalPlaceholder(definitionElement, definition.selector);
           }
         } else {
           assert(definition.selector is FunctionExpression);
-          if (definitionElement.kind === ElementKind.FIELD_PARAMETER) {
+          if (identical(definitionElement.kind, ElementKind.FIELD_PARAMETER)) {
             tryMakeMemberPlaceholder(
                 definition.selector.asFunctionExpression().name);
           }
@@ -541,17 +542,17 @@
 
   visitFunctionExpression(FunctionExpression node) {
     bool isKeyword(Identifier id) =>
-        id !== null && Keyword.keywords[id.source.slowToString()] !== null;
+        id != null && Keyword.keywords[id.source.slowToString()] != null;
 
     Element element = treeElements[node];
     // May get null here in case of A(int this.f());
-    if (element !== null) {
+    if (element != null) {
       // Rename only local functions.
-      if (topmostEnclosingFunction === null) {
+      if (topmostEnclosingFunction == null) {
         topmostEnclosingFunction = element;
       }
-      if (element !== currentElement) {
-        if (node.name !== null) {
+      if (!identical(element, currentElement)) {
+        if (node.name != null) {
           assert(node.name is Identifier);
           tryMakeLocalPlaceholder(element, node.name);
         }
@@ -563,14 +564,14 @@
     // int interface() => 1;
     // But omitting 'int' makes VM unhappy.
     // TODO(smok): Remove it when http://dartbug.com/5278 is fixed.
-    if (node.name === null || !isKeyword(node.name.asIdentifier())) {
+    if (node.name == null || !isKeyword(node.name.asIdentifier())) {
       makeOmitDeclarationTypePlaceholder(node.returnType);
     }
     collectFunctionParameters(node.parameters);
   }
 
   void collectFunctionParameters(NodeList parameters) {
-    if (parameters === null) return;
+    if (parameters == null) return;
     for (Node parameter in parameters.nodes) {
       if (parameter is NodeList) {
         // Optional parameter list.
@@ -587,11 +588,11 @@
     ClassElement classElement = currentElement;
     makeElementPlaceholder(node.name, classElement);
     node.visitChildren(this);
-    if (node.defaultClause !== null) {
+    if (node.defaultClause != null) {
       // Can't just visit class node's default clause because of the bug in the
       // resolver, it just crashes when it meets type variable.
       DartType defaultType = classElement.defaultClass;
-      assert(defaultType !== null);
+      assert(defaultType != null);
       makeTypePlaceholder(node.defaultClause.typeName, defaultType);
       visit(node.defaultClause.typeArguments);
     }
@@ -605,7 +606,7 @@
     // lib1: interface I<K> default C<K> {...}
     // lib2: class C<K> {...}
     if (typeDeclaration is ClassElement
-        && (typeDeclaration as ClassElement).defaultClass !== null) {
+        && (typeDeclaration as ClassElement).defaultClass != null) {
       typeDeclaration = (typeDeclaration as ClassElement).defaultClass.element;
     }
     // Another poor man type resolution.
diff --git a/lib/compiler/implementation/dart_backend/renamer.dart b/lib/compiler/implementation/dart_backend/renamer.dart
index 6c4bab4..8f8521e 100644
--- a/lib/compiler/implementation/dart_backend/renamer.dart
+++ b/lib/compiler/implementation/dart_backend/renamer.dart
@@ -199,7 +199,7 @@
         (functionElement, functionScope) {
       Set<LocalPlaceholder> placeholders = functionScope.localPlaceholders;
       Set<String> memberIdentifiers = new Set<String>();
-      if (functionElement.getEnclosingClass() !== null) {
+      if (functionElement.getEnclosingClass() != null) {
         functionElement.getEnclosingClass().forEachMember(
             (enclosingClass, member) {
               memberIdentifiers.add(member.name.slowToString());
diff --git a/lib/compiler/implementation/dart_backend/utils.dart b/lib/compiler/implementation/dart_backend/utils.dart
index 53f75ea..44ea494 100644
--- a/lib/compiler/implementation/dart_backend/utils.dart
+++ b/lib/compiler/implementation/dart_backend/utils.dart
@@ -10,16 +10,16 @@
       : cloneTreeElements = new TreeElementMapping();
 
   visit(Node node) {
-    if (node === null) return null;
+    if (node == null) return null;
     final clone = node.accept(this);
     final originalElement = originalTreeElements[node];
-    if (originalElement !== null) {
+    if (originalElement != null) {
       cloneTreeElements[clone] = originalElement;
     }
     TypeAnnotation asTypeAnnotation = node.asTypeAnnotation();
-    if (asTypeAnnotation !== null) {
+    if (asTypeAnnotation != null) {
       final originalType = originalTreeElements.getType(asTypeAnnotation);
-      if (originalType !== null) {
+      if (originalType != null) {
         cloneTreeElements.setType(clone.asTypeAnnotation(), originalType);
       }
     }
diff --git a/lib/compiler/implementation/diagnostic_listener.dart b/lib/compiler/implementation/diagnostic_listener.dart
index 139871c..e684e9e 100644
--- a/lib/compiler/implementation/diagnostic_listener.dart
+++ b/lib/compiler/implementation/diagnostic_listener.dart
@@ -4,15 +4,15 @@
 
 abstract class DiagnosticListener {
   // TODO(karlklose): replace cancel with better error reporting mechanism.
-  void cancel([String reason, node, token, instruction, element]);
+  void cancel(String reason, {node, token, instruction, element});
   // TODO(karlklose): rename log to something like reportInfo.
   void log(message);
   // TODO(karlklose): add reportWarning and reportError to this interface.
 
   void internalErrorOnElement(Element element, String message);
   void internalError(String message,
-                     [Node node, Token token, HInstruction instruction,
-                      Element element]);
+                     {Node node, Token token, HInstruction instruction,
+                      Element element});
 
   SourceSpan spanFromNode(Node node, [Uri uri]);
 
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index dc70d0f..e3a46e2 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -2,17 +2,29 @@
 // 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('elements');
+library elements;
 
-#import('dart:uri');
+import 'dart:uri';
 
 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed.
-#import('../../compiler.dart', prefix: 'api_e');
-#import('../tree/tree.dart');
-#import('../scanner/scannerlib.dart');
-#import('../leg.dart');  // TODO(karlklose): we only need type.
-#import('../universe/universe.dart');
-#import('../util/util.dart');
+import '../../compiler.dart' as api_e;
+import '../tree/tree.dart';
+import '../dart2jslib.dart' show invariant,
+                                 InterfaceType,
+                                 DartType,
+                                 TypeVariableType,
+                                 TypedefType,
+                                 MessageKind,
+                                 DiagnosticListener,
+                                 Script,
+                                 FunctionType,
+                                 SourceString,
+                                 Selector,
+                                 Constant,
+                                 Compiler;
+import '../scanner/scannerlib.dart' show Token, EOF_TOKEN;
+import '../util/util.dart';
+import '../resolution/resolution.dart';
 
 const int STATE_NOT_STARTED = 0;
 const int STATE_STARTED = 1;
@@ -117,7 +129,7 @@
   Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>();
 
   Element(this.name, this.kind, this.enclosingElement) {
-    assert(isErroneous() || getImplementationLibrary() !== null);
+    assert(isErroneous() || getImplementationLibrary() != null);
   }
 
   Modifiers get modifiers => Modifiers.EMPTY;
@@ -131,38 +143,39 @@
   }
 
   void addMetadata(MetadataAnnotation annotation) {
-    assert(annotation.annotatedElement === null);
+    assert(annotation.annotatedElement == null);
     annotation.annotatedElement = this;
     metadata = metadata.prepend(annotation);
   }
 
-  bool isFunction() => kind === ElementKind.FUNCTION;
+  bool isFunction() => identical(kind, ElementKind.FUNCTION);
   bool isConstructor() => isFactoryConstructor() || isGenerativeConstructor();
   bool isClosure() => false;
   bool isMember() {
     // Check that this element is defined in the scope of a Class.
-    return enclosingElement !== null && enclosingElement.isClass();
+    return enclosingElement != null && enclosingElement.isClass();
   }
   bool isInstanceMember() => false;
   bool isFactoryConstructor() => modifiers.isFactory();
-  bool isGenerativeConstructor() => kind === ElementKind.GENERATIVE_CONSTRUCTOR;
+  bool isGenerativeConstructor() =>
+      identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR);
   bool isGenerativeConstructorBody() =>
-      kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY;
-  bool isCompilationUnit() => kind === ElementKind.COMPILATION_UNIT;
-  bool isClass() => kind === ElementKind.CLASS;
-  bool isPrefix() => kind === ElementKind.PREFIX;
-  bool isVariable() => kind === ElementKind.VARIABLE;
-  bool isParameter() => kind === ElementKind.PARAMETER;
-  bool isStatement() => kind === ElementKind.STATEMENT;
-  bool isTypedef() => kind === ElementKind.TYPEDEF;
-  bool isTypeVariable() => kind === ElementKind.TYPE_VARIABLE;
-  bool isField() => kind === ElementKind.FIELD;
-  bool isAbstractField() => kind === ElementKind.ABSTRACT_FIELD;
-  bool isGetter() => kind === ElementKind.GETTER;
-  bool isSetter() => kind === ElementKind.SETTER;
+      identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR_BODY);
+  bool isCompilationUnit() => identical(kind, ElementKind.COMPILATION_UNIT);
+  bool isClass() => identical(kind, ElementKind.CLASS);
+  bool isPrefix() => identical(kind, ElementKind.PREFIX);
+  bool isVariable() => identical(kind, ElementKind.VARIABLE);
+  bool isParameter() => identical(kind, ElementKind.PARAMETER);
+  bool isStatement() => identical(kind, ElementKind.STATEMENT);
+  bool isTypedef() => identical(kind, ElementKind.TYPEDEF);
+  bool isTypeVariable() => identical(kind, ElementKind.TYPE_VARIABLE);
+  bool isField() => identical(kind, ElementKind.FIELD);
+  bool isAbstractField() => identical(kind, ElementKind.ABSTRACT_FIELD);
+  bool isGetter() => identical(kind, ElementKind.GETTER);
+  bool isSetter() => identical(kind, ElementKind.SETTER);
   bool isAccessor() => isGetter() || isSetter();
-  bool isForeign() => kind === ElementKind.FOREIGN;
-  bool isLibrary() => kind === ElementKind.LIBRARY;
+  bool isForeign() => identical(kind, ElementKind.FOREIGN);
+  bool isLibrary() => identical(kind, ElementKind.LIBRARY);
   bool impliesType() => (kind.category & ElementCategory.IMPLIES_TYPE) != 0;
   bool isExtendable() => (kind.category & ElementCategory.IS_EXTENDABLE) != 0;
 
@@ -217,12 +230,20 @@
    */
   Element get declaration => isPatch ? origin : this;
 
+  Element get patch {
+    throw new UnsupportedOperationException('patch is not supported on $this');
+  }
+
+  Element get origin {
+    throw new UnsupportedOperationException('origin is not supported on $this');
+  }
+
   // TODO(johnniwinther): This breaks for libraries (for which enclosing
   // elements are null) and is invalid for top level variable declarations for
   // which the enclosing element is a VariableDeclarations and not a compilation
   // unit.
   bool isTopLevel() {
-    return enclosingElement !== null && enclosingElement.isCompilationUnit();
+    return enclosingElement != null && enclosingElement.isCompilationUnit();
   }
 
   bool isAssignable() {
@@ -234,7 +255,7 @@
   Token position() => null;
 
   Token findMyName(Token token) {
-    for (Token t = token; t.kind !== EOF_TOKEN; t = t.next) {
+    for (Token t = token; !identical(t.kind, EOF_TOKEN); t = t.next) {
       if (t.value == name) return t;
     }
     return token;
@@ -243,7 +264,7 @@
   // TODO(kasperl): This is a very bad hash code for the element and
   // there's no reason why two elements with the same name should have
   // the same hash code. Replace this with a simple id in the element?
-  int hashCode() => name === null ? 0 : name.hashCode();
+  int hashCode() => name == null ? 0 : name.hashCode();
 
   CompilationUnitElement getCompilationUnit() {
     Element element = this;
@@ -257,28 +278,28 @@
 
   LibraryElement getImplementationLibrary() {
     Element element = this;
-    while (element.kind !== ElementKind.LIBRARY) {
+    while (!identical(element.kind, ElementKind.LIBRARY)) {
       element = element.enclosingElement;
     }
     return element;
   }
 
   ClassElement getEnclosingClass() {
-    for (Element e = this; e !== null; e = e.enclosingElement) {
+    for (Element e = this; e != null; e = e.enclosingElement) {
       if (e.isClass()) return e;
     }
     return null;
   }
 
   Element getEnclosingClassOrCompilationUnit() {
-   for (Element e = this; e !== null; e = e.enclosingElement) {
+   for (Element e = this; e != null; e = e.enclosingElement) {
       if (e.isClass() || e.isCompilationUnit()) return e;
     }
     return null;
   }
 
   Element getEnclosingMember() {
-    for (Element e = this; e !== null; e = e.enclosingElement) {
+    for (Element e = this; e != null; e = e.enclosingElement) {
       if (e.isMember()) return e;
     }
     return null;
@@ -286,7 +307,7 @@
 
   Element getOutermostEnclosingMemberOrTopLevel() {
     // TODO(lrn): Why is this called "Outermost"?
-    for (Element e = this; e !== null; e = e.enclosingElement) {
+    for (Element e = this; e != null; e = e.enclosingElement) {
       if (e.isMember() || e.isTopLevel()) {
         return e;
       }
@@ -313,9 +334,9 @@
   String toString() {
     // TODO(johnniwinther): Test for nullness of name, or make non-nullness an
     // invariant for all element types?
-    var nameText = name !== null ? name.slowToString() : '?';
-    if (enclosingElement !== null && !isTopLevel()) {
-      String holderName = enclosingElement.name !== null
+    var nameText = name != null ? name.slowToString() : '?';
+    if (enclosingElement != null && !isTopLevel()) {
+      String holderName = enclosingElement.name != null
           ? enclosingElement.name.slowToString()
           : '${enclosingElement.kind}?';
       return '$kind($holderName#${nameText})';
@@ -421,7 +442,7 @@
       addAccessorToScope(element, localScope[element.name], listener);
     } else {
       Element existing = localScope.putIfAbsent(element.name, () => element);
-      if (existing !== element) {
+      if (!identical(existing, element)) {
         // TODO(ahe): Do something similar to Resolver.reportErrorWithContext.
         listener.cancel('duplicate definition', token: element.position());
         listener.cancel('existing definition', token: existing.position());
@@ -432,7 +453,8 @@
   Element localLookup(SourceString elementName) {
     Element result = localScope[elementName];
     if (result == null && isPatch) {
-      result = origin.localScope[elementName];
+      ScopeContainerElement element = origin;
+      result = element.localScope[elementName];
     }
     return result;
   }
@@ -461,7 +483,7 @@
     }
 
     if (existing != null) {
-      if (existing.kind !== ElementKind.ABSTRACT_FIELD) {
+      if (!identical(existing.kind, ElementKind.ABSTRACT_FIELD)) {
         reportError(existing);
       } else {
         AbstractFieldElement field = existing;
@@ -595,7 +617,7 @@
   Link<Element> slotForExports;
 
   LibraryElement(Script script, [Uri uri, LibraryElement this.origin])
-    : this.uri = ((uri === null) ? script.uri : uri),
+    : this.uri = ((uri == null) ? script.uri : uri),
       importScope = new Map<SourceString, Element>(),
       super(new SourceString(script.name), ElementKind.LIBRARY, null) {
     entryCompilationUnit = new CompilationUnitElement(script, this);
@@ -604,8 +626,8 @@
     }
   }
 
-  bool get isPatched => patch !== null;
-  bool get isPatch => origin !== null;
+  bool get isPatched => patch != null;
+  bool get isPatch => origin != null;
 
   LibraryElement get declaration => super.declaration;
   LibraryElement get implementation => super.implementation;
@@ -629,7 +651,7 @@
    */
   void addImport(Element element, DiagnosticListener listener) {
     Element existing = importScope[element.name];
-    if (existing !== null) {
+    if (existing != null) {
       if (!existing.isErroneous()) {
         // TODO(johnniwinther): Provide access to both the new and existing
         // elements.
@@ -646,7 +668,7 @@
    * Returns [:true:] if the export scope has already been computed for this
    * library.
    */
-  bool get exportsHandled => slotForExports !== null;
+  bool get exportsHandled => slotForExports != null;
 
   Link<Element> get exports {
     assert(invariant(this, exportsHandled,
@@ -660,7 +682,7 @@
   void setExports(Iterable<Element> exportedElements) {
     assert(invariant(this, !exportsHandled,
         message: 'Exports already set to $slotForExports on $this'));
-    assert(invariant(this, exportedElements !== null));
+    assert(invariant(this, exportedElements != null));
     var builder = new LinkBuilder<Element>();
     for (Element export in exportedElements) {
       builder.addLast(export);
@@ -678,7 +700,7 @@
    */
   Element find(SourceString elementName) {
     Element result = localScope[elementName];
-    if (result === null) {
+    if (result == null) {
       result = importScope[elementName];
     }
     return result;
@@ -690,7 +712,7 @@
     // TODO(johnniwinther): How to handle injected elements in the patch
     // library?
     Element result = localScope[elementName];
-    if (result === null || result.getLibrary() != this) return null;
+    if (result == null || result.getLibrary() != this) return null;
     return result;
   }
 
@@ -715,7 +737,7 @@
     }
   }
 
-  bool hasLibraryName() => libraryTag !== null;
+  bool hasLibraryName() => libraryTag != null;
 
   /**
    * Returns the library name (as defined by the #library tag) or for script
@@ -723,7 +745,7 @@
    * to private 'library name' for scripts to use for instance in dartdoc.
    */
   String getLibraryOrScriptName() {
-    if (libraryTag !== null) {
+    if (libraryTag != null) {
       return libraryTag.name.toString();
     } else {
       // Use the file name as script name.
@@ -734,9 +756,9 @@
 
   // TODO(johnniwinther): Rewrite to avoid the optional argument.
   Scope buildEnclosingScope({bool patchScope: false}) {
-    if (origin !== null) {
+    if (origin != null) {
       return new PatchLibraryScope(origin, this);
-    } if (patchScope && patch !== null) {
+    } if (patchScope && patch != null) {
       return new PatchLibraryScope(this, patch);
     } else {
       return new TopScope(this);
@@ -746,9 +768,9 @@
   bool get isPlatformLibrary => uri.scheme == "dart";
 
   String toString() {
-    if (origin !== null) {
+    if (origin != null) {
       return 'patch library(${getLibraryOrScriptName()})';
-    } else if (patch !== null) {
+    } else if (patch != null) {
       return 'origin library(${getLibraryOrScriptName()})';
     } else {
       return 'library(${getLibraryOrScriptName()})';
@@ -793,7 +815,7 @@
   FunctionSignature functionSignature;
 
   TypedefType computeType(Compiler compiler) {
-    if (cachedType !== null) return cachedType;
+    if (cachedType != null) return cachedType;
     Typedef node = parseNode(compiler);
     Link<DartType> parameters =
         TypeDeclarationElement.createTypeVariables(this, node.typeParameters);
@@ -818,23 +840,23 @@
   Modifiers get modifiers => variables.modifiers;
 
   VariableElement(SourceString name,
-                  VariableListElement this.variables,
+                  VariableListElement variables,
                   ElementKind kind,
-                  Element enclosing,
-                  [Node node])
-    : super(name, kind, enclosing), cachedNode = node;
+                  this.cachedNode)
+    : this.variables = variables,
+      super(name, kind, variables.enclosingElement);
 
   Node parseNode(DiagnosticListener listener) {
-    if (cachedNode !== null) return cachedNode;
+    if (cachedNode != null) return cachedNode;
     VariableDefinitions definitions = variables.parseNode(listener);
     for (Link<Node> link = definitions.definitions.nodes;
          !link.isEmpty(); link = link.tail) {
       Expression initializedIdentifier = link.head;
       Identifier identifier = initializedIdentifier.asIdentifier();
-      if (identifier === null) {
+      if (identifier == null) {
         identifier = initializedIdentifier.asSendSet().selector.asIdentifier();
       }
-      if (name === identifier.source) {
+      if (identical(name, identifier.source)) {
         cachedNode = initializedIdentifier;
         return cachedNode;
       }
@@ -865,9 +887,8 @@
   FieldParameterElement(SourceString name,
                         this.fieldElement,
                         VariableListElement variables,
-                        Element enclosing,
                         Node node)
-      : super(name, variables, ElementKind.FIELD_PARAMETER, enclosing, node);
+      : super(name, variables, ElementKind.FIELD_PARAMETER, node);
 }
 
 // This element represents a list of variable or field declaration.
@@ -897,7 +918,7 @@
       : super(null, kind, enclosing),
         this.cachedNode = node,
         this.modifiers = node.modifiers {
-    assert(modifiers !== null);
+    assert(modifiers != null);
   }
 
   VariableDefinitions parseNode(DiagnosticListener listener) {
@@ -908,13 +929,13 @@
     if (type != null) return type;
     compiler.withCurrentElement(this, () {
       VariableDefinitions node = parseNode(compiler);
-      if (node.type !== null) {
+      if (node.type != null) {
         type = compiler.resolveTypeAnnotation(this, node.type);
       } else {
         // Is node.definitions exactly one FunctionExpression?
         Link<Node> link = node.definitions.nodes;
         if (!link.isEmpty() &&
-            link.head.asFunctionExpression() !== null &&
+            link.head.asFunctionExpression() != null &&
             link.tail.isEmpty()) {
           FunctionExpression functionExpression = link.head;
           // We found exactly one FunctionExpression
@@ -936,17 +957,6 @@
   bool isInstanceMember() {
     return isMember() && !modifiers.isStatic();
   }
-
-  // TODO(johnniwinther): Rewrite to avoid the optional argument.
-  Scope buildScope({bool patchScope: false}) {
-    Scope result = new VariableScope(
-        enclosingElement.buildScope(patchScope: patchScope), this);
-    if (enclosingElement.isClass()) {
-      Scope clsScope = result.parent;
-      clsScope.inStaticContext = !isInstanceMember();
-    }
-    return result;
-  }
 }
 
 class ForeignElement extends Element {
@@ -987,8 +997,8 @@
     //
     // We need to make sure that the position returned is relative to
     // the compilation unit of the abstract element.
-    if (getter !== null
-        && getter.getCompilationUnit() === getCompilationUnit()) {
+    if (getter != null
+        && identical(getter.getCompilationUnit(), getCompilationUnit())) {
       return getter.position();
     } else {
       return setter.position();
@@ -997,7 +1007,7 @@
 
   Modifiers get modifiers {
     // The resolver ensures that the flags match (ignoring abstract).
-    if (getter !== null) {
+    if (getter != null) {
       return new Modifiers.withFlags(
           getter.modifiers.nodes,
           getter.modifiers.flags | Modifiers.FLAG_ABSTRACT);
@@ -1119,12 +1129,12 @@
                                      Element enclosing,
                                      FunctionSignature this.functionSignature)
       : super(name, kind, enclosing) {
-    assert(modifiers !== null);
+    assert(modifiers != null);
     defaultImplementation = this;
   }
 
-  bool get isPatched => patch !== null;
-  bool get isPatch => origin !== null;
+  bool get isPatched => patch != null;
+  bool get isPatch => origin != null;
 
   /**
    * Applies a patch function to this function. The patch function's body
@@ -1134,7 +1144,7 @@
    */
   void setPatch(FunctionElement patchElement) {
     // Sanity checks. The caller must check these things before calling.
-    assert(patch === null);
+    assert(patch == null);
     this.patch = patchElement;
   }
 
@@ -1145,7 +1155,7 @@
   }
 
   FunctionSignature computeSignature(Compiler compiler) {
-    if (functionSignature !== null) return functionSignature;
+    if (functionSignature != null) return functionSignature;
     compiler.withCurrentElement(this, () {
       functionSignature = compiler.resolveSignature(this);
     });
@@ -1172,7 +1182,7 @@
   }
 
   Node parseNode(DiagnosticListener listener) {
-    if (patch === null) {
+    if (patch == null) {
       if (modifiers.isExternal()) {
         listener.cancel("Compiling external function with no implementation.",
                         element: this);
@@ -1194,17 +1204,6 @@
       return super.toString();
     }
   }
-
-  // TODO(johnniwinther): Rewrite to avoid the optional argument.
-  Scope buildScope({bool patchScope: false}) {
-    Scope result = new MethodScope(
-        enclosingElement.buildScope(patchScope: patchScope), this);
-    if (enclosingElement.isClass()) {
-      Scope clsScope = result.parent;
-      clsScope.inStaticContext = !isInstanceMember() && !isConstructor();
-    }
-    return result;
-  }
 }
 
 class ConstructorBodyElement extends FunctionElement {
@@ -1226,9 +1225,9 @@
   }
 
   Node parseNode(DiagnosticListener listener) {
-    if (cachedNode !== null) return cachedNode;
+    if (cachedNode != null) return cachedNode;
     cachedNode = constructor.parseNode(listener);
-    assert(cachedNode !== null);
+    assert(cachedNode != null);
     return cachedNode;
   }
 
@@ -1276,7 +1275,7 @@
    */
   static Link<DartType> createTypeVariables(TypeDeclarationElement element,
                                         NodeList parameters) {
-    if (parameters === null) return const Link<DartType>();
+    if (parameters == null) return const Link<DartType>();
 
     // Create types and elements for type variable.
     var arguments = new LinkBuilder<DartType>();
@@ -1323,7 +1322,7 @@
 
   InterfaceType computeType(compiler) {
     if (type == null) {
-      if (origin === null) {
+      if (origin == null) {
         ClassNode node = parseNode(compiler);
         Link<DartType> parameters =
             TypeDeclarationElement.createTypeVariables(this,
@@ -1346,7 +1345,7 @@
    * Return [:true:] if this element is the [:Object:] class for the [compiler].
    */
   bool isObject(Compiler compiler) =>
-      declaration === compiler.objectClass;
+      identical(declaration, compiler.objectClass);
 
   Link<DartType> get typeVariables => type.arguments;
 
@@ -1362,7 +1361,7 @@
    */
   Element lookupLocalMember(SourceString memberName) {
     var result = localLookup(memberName);
-    if (result !== null && result.isConstructor()) return null;
+    if (result != null && result.isConstructor()) return null;
     return result;
   }
 
@@ -1383,10 +1382,10 @@
     bool isPrivate = memberName.isPrivate();
     for (ClassElement s = superclass; s != null; s = s.superclass) {
       // Private members from a different library are not visible.
-      if (isPrivate && library !== s.getLibrary()) continue;
+      if (isPrivate && !identical(library, s.getLibrary())) continue;
       s = includeInjectedMembers ? s.implementation : s;
       Element e = s.lookupLocalMember(memberName);
-      if (e === null) continue;
+      if (e == null) continue;
       // Static members are not inherited.
       if (e.modifiers.isStatic()) continue;
       return e;
@@ -1405,9 +1404,9 @@
       ClassElement cls = t.element;
       cls = includeInjectedMembers ? cls.implementation : cls;
       Element e = cls.lookupLocalMember(memberName);
-      if (e === null) continue;
+      if (e == null) continue;
       // Private members from a different library are not visible.
-      if (isPrivate && fromLibrary !== e.getLibrary()) continue;
+      if (isPrivate && !identical(fromLibrary, e.getLibrary())) continue;
       // Static members are not inherited.
       if (e.modifiers.isStatic()) continue;
       return e;
@@ -1444,7 +1443,7 @@
    */
   Element lookupMember(SourceString memberName) {
     Element localMember = lookupLocalMember(memberName);
-    return localMember === null ? lookupSuperMember(memberName) : localMember;
+    return localMember == null ? lookupSuperMember(memberName) : localMember;
   }
 
   /**
@@ -1478,11 +1477,11 @@
   Element validateConstructorLookupResults(Selector selector,
                                            Element result,
                                            Element noMatch(Element)) {
-    if (result === null
+    if (result == null
         || !result.isConstructor()
         || (selector.name.isPrivate()
             && result.getLibrary() != selector.library)) {
-      result = noMatch !== null ? noMatch(result) : null;
+      result = noMatch != null ? noMatch(result) : null;
     }
     return result;
   }
@@ -1494,8 +1493,8 @@
     SourceString normalizedName;
     SourceString className = this.name;
     SourceString constructorName = selector.name;
-    if (constructorName !== const SourceString('') &&
-        ((className === null) ||
+    if (!identical(constructorName, const SourceString('')) &&
+        ((className == null) ||
          (constructorName.slowToString() != className.slowToString()))) {
       normalizedName = Elements.constructConstructorName(className,
                                                          constructorName);
@@ -1538,7 +1537,7 @@
    */
   ClassElement get superclass {
     assert(supertypeLoadState == STATE_DONE);
-    return supertype === null ? null : supertype.element;
+    return supertype == null ? null : supertype.element;
   }
 
   /**
@@ -1551,9 +1550,9 @@
    * and patch class are included.
    */
   // TODO(johnniwinther): Clean up lookup to get rid of the include predicates.
-  void forEachMember([void f(ClassElement enclosingClass, Element member),
-                      includeBackendMembers = false,
-                      includeSuperMembers = false]) {
+  void forEachMember(void f(ClassElement enclosingClass, Element member),
+                     {includeBackendMembers: false,
+                      includeSuperMembers: false}) {
     bool includeInjectedMembers = isPatch;
     Set<ClassElement> seen = new Set<ClassElement>();
     ClassElement classElement = declaration;
@@ -1583,7 +1582,7 @@
         }
       }
       classElement = includeSuperMembers ? classElement.superclass : null;
-    } while(classElement !== null);
+    } while(classElement != null);
   }
 
   /**
@@ -1599,9 +1598,9 @@
    * When called on the implementation element both the fields declared in the
    * origin and in the patch are included.
    */
-  void forEachInstanceField([void f(ClassElement enclosingClass, Element field),
-                             includeBackendMembers = false,
-                             includeSuperMembers = false]) {
+  void forEachInstanceField(void f(ClassElement enclosingClass, Element field),
+                            {includeBackendMembers: false,
+                             includeSuperMembers: false}) {
     // Filters so that [f] is only invoked with instance fields.
     void fieldFilter(ClassElement enclosingClass, Element member) {
       if (member.isInstanceMember() && member.kind == ElementKind.FIELD) {
@@ -1609,13 +1608,15 @@
       }
     }
 
-    forEachMember(fieldFilter, includeBackendMembers, includeSuperMembers);
+    forEachMember(fieldFilter,
+                  includeBackendMembers: includeBackendMembers,
+                  includeSuperMembers: includeSuperMembers);
   }
 
   bool implementsInterface(ClassElement intrface) {
     for (DartType implementedInterfaceType in allSupertypes) {
       ClassElement implementedInterface = implementedInterfaceType.element;
-      if (implementedInterface === intrface) {
+      if (identical(implementedInterface, intrface)) {
         return true;
       }
     }
@@ -1631,7 +1632,7 @@
    */
   bool isSubclassOf(ClassElement cls) {
     for (ClassElement s = this; s != null; s = s.superclass) {
-      if (s === cls) return true;
+      if (identical(s, cls)) return true;
     }
     return false;
   }
@@ -1642,10 +1643,10 @@
 
   // TODO(johnniwinther): Rewrite to avoid the optional argument.
   Scope buildScope({bool patchScope: false}) {
-    if (origin !== null) {
+    if (origin != null) {
       return new PatchClassScope(
           enclosingElement.buildScope(patchScope: patchScope), origin, this);
-    } else if (patchScope && patch !== null) {
+    } else if (patchScope && patch != null) {
       return new PatchClassScope(
           enclosingElement.buildScope(patchScope: patchScope), this, patch);
     } else {
@@ -1655,7 +1656,7 @@
   }
 
   Scope buildLocalScope() {
-    if (origin !== null) {
+    if (origin != null) {
       return new LocalPatchClassScope(origin, this);
     } else {
       return new LocalClassScope(this);
@@ -1667,9 +1668,9 @@
   }
 
   String toString() {
-    if (origin !== null) {
+    if (origin != null) {
       return 'patch ${super.toString()}';
-    } else if (patch !== null) {
+    } else if (patch != null) {
       return 'origin ${super.toString()}';
     } else {
       return super.toString();
@@ -1686,17 +1687,17 @@
             && !element.isInstanceMember()
             && !isStaticOrTopLevelField(element)
             && !isStaticOrTopLevelFunction(element)
-            && (element.kind === ElementKind.VARIABLE ||
-                element.kind === ElementKind.PARAMETER ||
-                element.kind === ElementKind.FUNCTION);
+            && (identical(element.kind, ElementKind.VARIABLE) ||
+                identical(element.kind, ElementKind.PARAMETER) ||
+                identical(element.kind, ElementKind.FUNCTION));
   }
 
   static bool isInstanceField(Element element) {
     return !Elements.isUnresolved(element)
            && element.isInstanceMember()
-           && (element.kind === ElementKind.FIELD
-               || element.kind === ElementKind.GETTER
-               || element.kind === ElementKind.SETTER);
+           && (identical(element.kind, ElementKind.FIELD)
+               || identical(element.kind, ElementKind.GETTER)
+               || identical(element.kind, ElementKind.SETTER));
   }
 
   static bool isStaticOrTopLevel(Element element) {
@@ -1709,7 +1710,7 @@
     return !Elements.isUnresolved(element)
            && !element.isInstanceMember()
            && !element.isPrefix()
-           && element.enclosingElement !== null
+           && element.enclosingElement != null
            && (element.enclosingElement.kind == ElementKind.CLASS ||
                element.enclosingElement.kind == ElementKind.COMPILATION_UNIT ||
                element.enclosingElement.kind == ElementKind.LIBRARY);
@@ -1717,34 +1718,34 @@
 
   static bool isStaticOrTopLevelField(Element element) {
     return isStaticOrTopLevel(element)
-           && (element.kind === ElementKind.FIELD
-               || element.kind === ElementKind.GETTER
-               || element.kind === ElementKind.SETTER);
+           && (identical(element.kind, ElementKind.FIELD)
+               || identical(element.kind, ElementKind.GETTER)
+               || identical(element.kind, ElementKind.SETTER));
   }
 
   static bool isStaticOrTopLevelFunction(Element element) {
     return isStaticOrTopLevel(element)
-           && (element.kind === ElementKind.FUNCTION);
+           && (identical(element.kind, ElementKind.FUNCTION));
   }
 
   static bool isInstanceMethod(Element element) {
     return !Elements.isUnresolved(element)
            && element.isInstanceMember()
-           && (element.kind === ElementKind.FUNCTION);
+           && (identical(element.kind, ElementKind.FUNCTION));
   }
 
   static bool isInstanceSend(Send send, TreeElements elements) {
     Element element = elements[send];
-    if (element === null) return !isClosureSend(send, element);
+    if (element == null) return !isClosureSend(send, element);
     return isInstanceMethod(element) || isInstanceField(element);
   }
 
   static bool isClosureSend(Send send, Element element) {
     if (send.isPropertyAccess) return false;
-    if (send.receiver !== null) return false;
+    if (send.receiver != null) return false;
     // (o)() or foo()().
-    if (element === null && send.selector.asIdentifier() === null) return true;
-    if (element === null) return false;
+    if (element == null && send.selector.asIdentifier() == null) return true;
+    if (element == null) return false;
     // foo() with foo a local or a parameter.
     return isLocal(element);
   }
@@ -1762,51 +1763,51 @@
   static SourceString constructOperatorName(SourceString selector,
                                             bool isUnary) {
     String str = selector.stringValue;
-    if (str === '==' || str === '!=') return OPERATOR_EQUALS;
+    if (identical(str, '==') || identical(str, '!=')) return OPERATOR_EQUALS;
 
-    if (str === '~') {
+    if (identical(str, '~')) {
       str = 'not';
-    } else if (str === '-' && isUnary) {
+    } else if (identical(str, '-') && isUnary) {
       // TODO(ahe): Return something like 'unary -'.
       return const SourceString('negate');
-    } else if (str === '[]') {
+    } else if (identical(str, '[]')) {
       str = 'index';
-    } else if (str === '[]=') {
+    } else if (identical(str, '[]=')) {
       str = 'indexSet';
-    } else if (str === '*' || str === '*=') {
+    } else if (identical(str, '*') || identical(str, '*=')) {
       str = 'mul';
-    } else if (str === '/' || str === '/=') {
+    } else if (identical(str, '/') || identical(str, '/=')) {
       str = 'div';
-    } else if (str === '%' || str === '%=') {
+    } else if (identical(str, '%') || identical(str, '%=')) {
       str = 'mod';
-    } else if (str === '~/' || str === '~/=') {
+    } else if (identical(str, '~/') || identical(str, '~/=')) {
       str = 'tdiv';
-    } else if (str === '+' || str === '+=') {
+    } else if (identical(str, '+') || identical(str, '+=')) {
       str = 'add';
-    } else if (str === '-' || str === '-=') {
+    } else if (identical(str, '-') || identical(str, '-=')) {
       str = 'sub';
-    } else if (str === '<<' || str === '<<=') {
+    } else if (identical(str, '<<') || identical(str, '<<=')) {
       str = 'shl';
-    } else if (str === '>>' || str === '>>=') {
+    } else if (identical(str, '>>') || identical(str, '>>=')) {
       str = 'shr';
-    } else if (str === '>=') {
+    } else if (identical(str, '>=')) {
       str = 'ge';
-    } else if (str === '>') {
+    } else if (identical(str, '>')) {
       str = 'gt';
-    } else if (str === '<=') {
+    } else if (identical(str, '<=')) {
       str = 'le';
-    } else if (str === '<') {
+    } else if (identical(str, '<')) {
       str = 'lt';
-    } else if (str === '&' || str === '&=') {
+    } else if (identical(str, '&') || identical(str, '&=')) {
       str = 'and';
-    } else if (str === '^' || str === '^=') {
+    } else if (identical(str, '^') || identical(str, '^=')) {
       str = 'xor';
-    } else if (str === '|' || str === '|=') {
+    } else if (identical(str, '|') || identical(str, '|=')) {
       str = 'or';
     } else if (selector == const SourceString('negate')) {
       // TODO(ahe): Remove this case: Legacy support for pre-0.11 spec.
       return selector;
-    } else if (str === '?') {
+    } else if (identical(str, '?')) {
       return selector;
     } else {
       throw new Exception('Unhandled selector: ${selector.slowToString()}');
@@ -1817,18 +1818,18 @@
   static SourceString mapToUserOperator(SourceString op) {
     String value = op.stringValue;
 
-    if (value === '!=') return const SourceString('==');
-    if (value === '*=') return const SourceString('*');
-    if (value === '/=') return const SourceString('/');
-    if (value === '%=') return const SourceString('%');
-    if (value === '~/=') return const SourceString('~/');
-    if (value === '+=') return const SourceString('+');
-    if (value === '-=') return const SourceString('-');
-    if (value === '<<=') return const SourceString('<<');
-    if (value === '>>=') return const SourceString('>>');
-    if (value === '&=') return const SourceString('&');
-    if (value === '^=') return const SourceString('^');
-    if (value === '|=') return const SourceString('|');
+    if (identical(value, '!=')) return const SourceString('==');
+    if (identical(value, '*=')) return const SourceString('*');
+    if (identical(value, '/=')) return const SourceString('/');
+    if (identical(value, '%=')) return const SourceString('%');
+    if (identical(value, '~/=')) return const SourceString('~/');
+    if (identical(value, '+=')) return const SourceString('+');
+    if (identical(value, '-=')) return const SourceString('-');
+    if (identical(value, '<<=')) return const SourceString('<<');
+    if (identical(value, '>>=')) return const SourceString('>>');
+    if (identical(value, '&=')) return const SourceString('&');
+    if (identical(value, '^=')) return const SourceString('^');
+    if (identical(value, '|=')) return const SourceString('|');
 
     throw 'Unhandled operator: ${op.slowToString()}';
   }
diff --git a/lib/compiler/implementation/enqueue.dart b/lib/compiler/implementation/enqueue.dart
index f2e9101..0e97273 100644
--- a/lib/compiler/implementation/enqueue.dart
+++ b/lib/compiler/implementation/enqueue.dart
@@ -48,7 +48,7 @@
       queue = new Queue<WorkItem>(),
       resolvedElements = new Map<Element, TreeElements>();
 
-  bool get isResolutionQueue => compiler.enqueuer.resolution === this;
+  bool get isResolutionQueue => identical(compiler.enqueuer.resolution, this);
 
   TreeElements getCachedElements(Element element) {
     // TODO(ngeoffray): Get rid of this check.
@@ -79,14 +79,14 @@
     assert(invariant(element, element.isDeclaration));
     if (element.isForeign()) return;
     if (queueIsClosed) {
-      if (isResolutionQueue && getCachedElements(element) !== null) return;
+      if (isResolutionQueue && getCachedElements(element) != null) return;
       compiler.internalErrorOnElement(element, "Work list is closed.");
     }
     if (!isResolutionQueue &&
-        element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) {
+        identical(element.kind, ElementKind.GENERATIVE_CONSTRUCTOR)) {
       registerInstantiatedClass(element.getEnclosingClass());
     }
-    if (elements === null) {
+    if (elements == null) {
       elements = getCachedElements(element);
     }
     if (isResolutionQueue) {
@@ -142,7 +142,7 @@
       // Run through the classes and see if we need to compile methods.
       for (ClassElement classElement in universe.instantiatedClasses) {
         for (ClassElement currentClass = classElement;
-             currentClass !== null;
+             currentClass != null;
              currentClass = currentClass.superclass) {
           processInstantiatedClass(currentClass);
         }
@@ -161,7 +161,7 @@
   void processInstantiatedClassMember(ClassElement cls, Element member) {
     assert(invariant(member, member.isDeclaration));
     if (universe.generatedCode.containsKey(member)) return;
-    if (resolvedElements[member] !== null) return;
+    if (resolvedElements[member] != null) return;
     if (!member.isInstanceMember()) return;
     if (member.isField()) return;
 
@@ -195,7 +195,7 @@
       if (universe.hasInvocation(member, compiler)) {
         return addToWorkList(member);
       }
-    } else if (member.kind === ElementKind.SETTER) {
+    } else if (identical(member.kind, ElementKind.SETTER)) {
       if (universe.hasInvokedSetter(member, compiler)) {
         return addToWorkList(member);
       }
@@ -276,7 +276,7 @@
   processInstanceMembers(SourceString n, bool f(Element e)) {
     String memberName = n.slowToString();
     Link<Element> members = instanceMembersByName[memberName];
-    if (members !== null) {
+    if (members != null) {
       LinkBuilder<Element> remaining = new LinkBuilder<Element>();
       for (; !members.isEmpty(); members = members.tail) {
         if (!f(members.head)) remaining.addLast(members.head);
@@ -312,7 +312,7 @@
   }
 
   void registerDynamicInvocation(SourceString methodName, Selector selector) {
-    assert(selector !== null);
+    assert(selector != null);
     registerInvocation(methodName, selector);
   }
 
diff --git a/lib/compiler/implementation/js/js.dart b/lib/compiler/implementation/js/js.dart
index 433352f..b7df642 100644
--- a/lib/compiler/implementation/js/js.dart
+++ b/lib/compiler/implementation/js/js.dart
@@ -2,14 +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.
 
-#library('js');
+library js;
 
-#import("precedence.dart");
-#import("../util/characters.dart", prefix: "charCodes");
+import 'precedence.dart';
+import '../util/characters.dart' as charCodes;
 
 // TODO(floitsch): remove this dependency (currently necessary for the
 // CodeBuffer).
-#import('../leg.dart', prefix: "leg");
+import '../dart2jslib.dart' as leg;
 
-#source('nodes.dart');
-#source('printer.dart');
+part 'nodes.dart';
+part 'printer.dart';
diff --git a/lib/compiler/implementation/js/nodes.dart b/lib/compiler/implementation/js/nodes.dart
index 6be4035..dcdba6e 100644
--- a/lib/compiler/implementation/js/nodes.dart
+++ b/lib/compiler/implementation/js/nodes.dart
@@ -222,9 +222,9 @@
   accept(NodeVisitor visitor) => visitor.visitFor(this);
 
   void visitChildren(NodeVisitor visitor) {
-    if (init !== null) init.accept(visitor);
-    if (condition !== null) condition.accept(visitor);
-    if (update !== null) update.accept(visitor);
+    if (init != null) init.accept(visitor);
+    if (condition != null) condition.accept(visitor);
+    if (update != null) update.accept(visitor);
     body.accept(visitor);
   }
 }
@@ -327,8 +327,8 @@
 
   void visitChildren(NodeVisitor visitor) {
     body.accept(visitor);
-    if (catchPart !== null) catchPart.accept(visitor);
-    if (finallyPart !== null) finallyPart.accept(visitor);
+    if (catchPart != null) catchPart.accept(visitor);
+    if (finallyPart != null) finallyPart.accept(visitor);
   }
 }
 
diff --git a/lib/compiler/implementation/js/printer.dart b/lib/compiler/implementation/js/printer.dart
index e29ef8d..02982ff 100644
--- a/lib/compiler/implementation/js/printer.dart
+++ b/lib/compiler/implementation/js/printer.dart
@@ -73,7 +73,7 @@
   }
 
   visitCommaSeparated(List<Node> nodes, int hasRequiredType,
-                      [bool newInForInit, bool newAtStatementBegin]) {
+                      {bool newInForInit, bool newAtStatementBegin}) {
     for (int i = 0; i < nodes.length; i++) {
       if (i != 0) {
         atStatementBegin = false;
@@ -81,7 +81,8 @@
         spaceOut();
       }
       visitNestedExpression(nodes[i], hasRequiredType,
-                            newInForInit, newAtStatementBegin);
+                            newInForInit: newInForInit,
+                            newAtStatementBegin: newAtStatementBegin);
     }
   }
 
@@ -93,7 +94,7 @@
     visitAll(program.body);
   }
 
-  bool blockBody(Node body, [bool needsSeparation, bool needsNewline]) {
+  bool blockBody(Node body, {bool needsSeparation, bool needsNewline}) {
     if (body is Block) {
       spaceOut();
       blockOut(body, false, needsNewline);
@@ -192,18 +193,18 @@
     outIndent("for");
     spaceOut();
     out("(");
-    if (loop.init !== null) {
+    if (loop.init != null) {
       visitNestedExpression(loop.init, EXPRESSION,
                             newInForInit: true, newAtStatementBegin: false);
     }
     out(";");
-    if (loop.condition !== null) {
+    if (loop.condition != null) {
       spaceOut();
       visitNestedExpression(loop.condition, EXPRESSION,
                             newInForInit: false, newAtStatementBegin: false);
     }
     out(";");
-    if (loop.update !== null) {
+    if (loop.update != null) {
       spaceOut();
       visitNestedExpression(loop.update, EXPRESSION,
                             newInForInit: false, newAtStatementBegin: false);
@@ -287,10 +288,10 @@
   visitTry(Try node) {
     outIndent("try");
     blockBody(node.body, needsSeparation: true, needsNewline: false);
-    if (node.catchPart !== null) {
+    if (node.catchPart != null) {
       visit(node.catchPart);
     }
-    if (node.finallyPart !== null) {
+    if (node.finallyPart != null) {
       spaceOut();
       out("finally");
       blockBody(node.finallyPart, needsSeparation: true, needsNewline: true);
@@ -351,7 +352,7 @@
     blockBody(node.body, needsSeparation: false, needsNewline: true);
   }
 
-  void functionOut(Fun fun, Node name) {
+  void functionOut(Fun fun, Node name, VarCollector vars) {
     out("function");
     if (name != null) {
       out(" ");
@@ -359,7 +360,7 @@
       visitNestedExpression(name, PRIMARY,
                             newInForInit: false, newAtStatementBegin: false);
     }
-    namer.enterScope();
+    namer.enterScope(vars);
     out("(");
     if (fun.params != null) {
       visitCommaSeparated(fun.params, PRIMARY,
@@ -371,13 +372,15 @@
   }
 
   visitFunctionDeclaration(FunctionDeclaration declaration) {
+    VarCollector vars = new VarCollector();
+    vars.visitFunctionDeclaration(declaration);
     indent();
-    functionOut(declaration.function, declaration.name);
+    functionOut(declaration.function, declaration.name, vars);
     lineOut();
   }
 
   visitNestedExpression(Expression node, int requiredPrecedence,
-                        [bool newInForInit, bool newAtStatementBegin]) {
+                        {bool newInForInit, bool newAtStatementBegin}) {
     bool needsParentheses =
         // a - (b + c).
         (requiredPrecedence != EXPRESSION &&
@@ -421,7 +424,7 @@
     visitNestedExpression(assignment.leftHandSide, LEFT_HAND_SIDE,
                           newInForInit: inForInit,
                           newAtStatementBegin: atStatementBegin);
-    if (assignment.value !== null) {
+    if (assignment.value != null) {
       spaceOut();
       String op = assignment.op;
       if (op != null) out(op);
@@ -613,11 +616,11 @@
   }
 
   visitVariableDeclaration(VariableDeclaration decl) {
-    out(namer.declareName(decl.name));
+    out(namer.getName(decl.name));
   }
 
   visitParameter(Parameter param) {
-    out(namer.declareName(param.name));
+    out(namer.getName(param.name));
   }
 
   bool isDigit(int charCode) {
@@ -665,11 +668,15 @@
   }
 
   visitNamedFunction(NamedFunction namedFunction) {
-    functionOut(namedFunction.function, namedFunction.name);
+    VarCollector vars = new VarCollector();
+    vars.visitNamedFunction(namedFunction);
+    functionOut(namedFunction.function, namedFunction.name, vars);
   }
 
   visitFun(Fun fun) {
-    functionOut(fun, null);
+    VarCollector vars = new VarCollector();
+    vars.visitFun(fun);
+    functionOut(fun, null, vars);
   }
 
   visitLiteralBool(LiteralBool node) {
@@ -778,6 +785,58 @@
   }
 }
 
+
+// Collects all the var declarations in the function.  We need to do this in a
+// separate pass because JS vars are lifted to the top of the function.
+class VarCollector extends BaseVisitor {
+  bool nested;
+  final Set<String> vars;
+  final List<String> ordered_vars;
+
+  VarCollector() : nested = false, vars = new Set<String>(), ordered_vars = [];
+
+  void forEach(void fn(String)) => ordered_vars.forEach(fn);
+
+  void collectVarsInFunction(Fun fun) {
+    if (!nested) {
+      nested = true;
+      if (fun.params != null) {
+        for (int i = 0; i < fun.params.length; i++) {
+          add(fun.params[i].name);
+        }
+      }
+      visitBlock(fun.body);
+      nested = false;
+    }
+  }
+
+  void add(String name) {
+    if (!vars.contains(name)) {
+      vars.add(name);
+      ordered_vars.add(name);
+    }
+  }
+
+  void visitFunctionDeclaration(FunctionDeclaration declaration) {
+    // Note that we don't bother collecting the name of the function.
+    collectVarsInFunction(declaration.function);
+  }
+
+  void visitNamedFunction(NamedFunction namedFunction) {
+    // Note that we don't bother collecting the name of the function.
+    collectVarsInFunction(namedFunction.function);
+  }
+
+  void visitFun(Fun fun) {
+    collectVarsInFunction(fun);
+  }
+
+  void visitVariableDeclaration(VariableDeclaration decl) {
+    add(decl.name);
+  }
+}
+
+
 /**
  * Returns true, if the given node must be wrapped into braces when used
  * as then-statement in an [If] that has an else branch.
@@ -839,7 +898,7 @@
 abstract class Namer {
   String getName(String oldName);
   String declareName(String oldName);
-  void enterScope();
+  void enterScope(VarCollector vars);
   void leaveScope();
 }
 
@@ -847,7 +906,7 @@
 class IdentityNamer implements Namer {
   String getName(String oldName) => oldName;
   String declareName(String oldName) => oldName;
-  void enterScope() {}
+  void enterScope(VarCollector vars) {}
   void leaveScope() {}
 }
 
@@ -859,9 +918,10 @@
 
   MinifyRenamer();
 
-  void enterScope() {
+  void enterScope(VarCollector vars) {
     maps.add(new Map<String, String>());
     nameNumberStack.add(nameNumber);
+    vars.forEach(declareName);
   }
 
   void leaveScope() {
@@ -886,6 +946,7 @@
     const LETTERS = 52;
     const DIGITS = 10;
     if (maps.isEmpty()) return oldName;
+
     String newName;
     int n = nameNumber;
     if (n < LETTERS) {
diff --git a/lib/compiler/implementation/js_backend/backend.dart b/lib/compiler/implementation/js_backend/backend.dart
index 2ef39e6..a196406 100644
--- a/lib/compiler/implementation/js_backend/backend.dart
+++ b/lib/compiler/implementation/js_backend/backend.dart
@@ -18,7 +18,7 @@
   void update(HType type, Recompile recompile) {
     HType newType = returnType != null ? returnType.union(type) : type;
     if (newType != returnType) {
-      if (returnType == null && newType === HType.UNKNOWN) {
+      if (returnType == null && identical(newType, HType.UNKNOWN)) {
         // If the first actual piece of information is not providing any type
         // information there is no need to recompile callers.
         compiledFunctions.clear();
@@ -113,7 +113,7 @@
 
   static const HTypeList ALL_UNKNOWN = const HTypeList.withAllUnknown();
 
-  bool get allUnknown => types === null;
+  bool get allUnknown => types == null;
   bool get hasNamedArguments => namedArguments != null;
   int get length => types.length;
   HType operator[](int index) => types[index];
@@ -203,7 +203,7 @@
       // If some optional parameters were passed positionally these have
       // already been filled.
       if (index == next) {
-        assert(result.types[index] === null);
+        assert(result.types[index] == null);
         HType type = null;
         if (hasNamedArguments &&
             selector.namedArguments.indexOf(element.name) >= 0) {
@@ -292,7 +292,7 @@
   int constructorCount(Element element) {
     assert(element.isClass());
     Set<Element> ctors = constructors[element];
-    return ctors === null ? 0 : ctors.length;
+    return ctors == null ? 0 : ctors.length;
   }
 
   void registerFieldType(Map<Element, HType> typeMap,
@@ -329,7 +329,7 @@
     // constructor.
     if (ctors.length == 2) {
       optimizedFunctions.forEach((Element field, _) {
-        if (field.enclosingElement === cls) {
+        if (identical(field.enclosingElement, cls)) {
           scheduleRecompilation(field);
         }
       });
@@ -391,7 +391,7 @@
     }
     HType initializerType = fieldInitializerTypeMap[field];
     HType constructorType = fieldConstructorTypeMap[field];
-    if (initializerType === null && constructorType === null) {
+    if (initializerType == null && constructorType == null) {
       // If there are no constructor type information return UNKNOWN. This
       // ensures that the function will be recompiled if useful constructor
       // type information becomes available.
@@ -401,7 +401,7 @@
     // initializer list.
     HType result = constructorType != null ? constructorType : initializerType;
     HType type = fieldTypeMap[field];
-    if (type !== null) result = result.union(type);
+    if (type != null) result = result.union(type);
     return result;
   }
 
@@ -479,7 +479,7 @@
     } else {
       if (oldTypes.allUnknown) return;
       HTypeList newTypes = oldTypes.unionWithInvoke(node, types);
-      if (newTypes === oldTypes) return;
+      if (identical(newTypes, oldTypes)) return;
       staticTypeMap[element] = newTypes;
       if (optimizedStaticFunctions.contains(element)) {
         backend.scheduleForRecompilation(element);
@@ -521,7 +521,7 @@
     } else {
       HTypeList oldTypes = selectorTypeMap[selector];
       HTypeList newTypes = oldTypes.unionWithInvoke(node, types);
-      if (newTypes === oldTypes) return;
+      if (identical(newTypes, oldTypes)) return;
       selectorTypeMap[selector] = newTypes;
     }
 
@@ -560,7 +560,7 @@
     if (Elements.isStaticOrTopLevelFunction(element) ||
         element.kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
       HTypeList types = staticTypeMap[element];
-      if (types !== null) {
+      if (types != null) {
         if (!optimizedStaticFunctions.contains(element)) {
           optimizedStaticFunctions.add(element);
         }
@@ -587,10 +587,10 @@
                                                   defaultValueTypes);
       }
       assert(types.allUnknown || types.length == signature.parameterCount);
-      found = (found === null) ? types : found.union(types);
+      found = (found == null) ? types : found.union(types);
       return !found.allUnknown;
     });
-    return found !== null ? found : HTypeList.ALL_UNKNOWN;
+    return found != null ? found : HTypeList.ALL_UNKNOWN;
   }
 
   void registerOptimizedFunction(Element element,
@@ -667,13 +667,17 @@
     return <CompilerTask>[builder, optimizer, generator, emitter];
   }
 
-  JavaScriptBackend(Compiler compiler, bool generateSourceMap)
+  JavaScriptBackend(Compiler compiler,
+                    bool generateSourceMap,
+                    bool disableEval)
       : namer = new Namer(compiler),
         returnInfo = new Map<Element, ReturnInfo>(),
         invalidateAfterCodegen = new List<Element>(),
         interceptors = new Interceptors(compiler),
-        super(compiler, constantSystem: JAVA_SCRIPT_CONSTANT_SYSTEM) {
-    emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
+        super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) {
+    emitter = disableEval
+        ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap)
+        : new CodeEmitterTask(compiler, namer, generateSourceMap);
     builder = new SsaBuilderTask(this);
     optimizer = new SsaOptimizerTask(this);
     generator = new SsaCodeGeneratorTask(this);
@@ -706,14 +710,14 @@
                         const SourceString('ConstantMap'),
                         const SourceString('ConstantProtoMap')]) {
       var e = compiler.findHelper(helper);
-      if (e !== null) world.registerInstantiatedClass(e);
+      if (e != null) world.registerInstantiatedClass(e);
     }
   }
 
   void codegen(WorkItem work) {
     if (work.element.kind.category == ElementCategory.VARIABLE) {
       Constant initialValue = compiler.constantHandler.compileWorkItem(work);
-      if (initialValue !== null) {
+      if (initialValue != null) {
         return;
       } else {
         // If the constant-handler was not able to produce a result we have to
@@ -918,7 +922,7 @@
       return nativeCheck
           ? const SourceString('stringSuperNativeTypeCheck')
           : const SourceString('stringSuperTypeCheck');
-    } else if (element === compiler.listClass) {
+    } else if (identical(element, compiler.listClass)) {
       return const SourceString('listTypeCheck');
     } else {
       if (Elements.isListSupertype(element, compiler)) {
diff --git a/lib/compiler/implementation/js_backend/constant_emitter.dart b/lib/compiler/implementation/js_backend/constant_emitter.dart
index 409c0b6..792cf27 100644
--- a/lib/compiler/implementation/js_backend/constant_emitter.dart
+++ b/lib/compiler/implementation/js_backend/constant_emitter.dart
@@ -93,19 +93,19 @@
     Iterator<int> iterator = string.iterator();
     while (iterator.hasNext()) {
       int code = iterator.next();
-      if (code === $SQ) {
+      if (identical(code, $SQ)) {
         buffer.add(r"\'");
-      } else if (code === $LF) {
+      } else if (identical(code, $LF)) {
         buffer.add(r'\n');
-      } else if (code === $CR) {
+      } else if (identical(code, $CR)) {
         buffer.add(r'\r');
-      } else if (code === $LS) {
+      } else if (identical(code, $LS)) {
         // This Unicode line terminator and $PS are invalid in JS string
         // literals.
         buffer.add(r'\u2028');
-      } else if (code === $PS) {
+      } else if (identical(code, $PS)) {
         buffer.add(r'\u2029');
-      } else if (code === $BACKSLASH) {
+      } else if (identical(code, $BACKSLASH)) {
         buffer.add(r'\\');
       } else {
         if (code > 0xffff) {
@@ -207,9 +207,7 @@
       // are in the same order as the members of the class element.
       int emittedArgumentCount = 0;
       classElement.implementation.forEachInstanceField(
-          includeBackendMembers: true,
-          includeSuperMembers: true,
-          f: (ClassElement enclosing, Element field) {
+          (ClassElement enclosing, Element field) {
             if (emittedArgumentCount != 0) buffer.add(", ");
             if (field.name == MapConstant.LENGTH_NAME) {
               buffer.add(constant.keys.entries.length);
@@ -218,15 +216,17 @@
             } else if (field.name == MapConstant.KEYS_NAME) {
               emitCanonicalVersionOfConstant(constant.keys, buffer);
             } else if (field.name == MapConstant.PROTO_VALUE) {
-              assert(constant.protoValue !== null);
+              assert(constant.protoValue != null);
               emitCanonicalVersionOfConstant(constant.protoValue, buffer);
             } else {
               badFieldCountError();
             }
             emittedArgumentCount++;
-          });
-      if ((constant.protoValue === null && emittedArgumentCount != 3) ||
-          (constant.protoValue !== null && emittedArgumentCount != 4)) {
+          },
+          includeBackendMembers: true,
+          includeSuperMembers: true);
+      if ((constant.protoValue == null && emittedArgumentCount != 3) ||
+          (constant.protoValue != null && emittedArgumentCount != 4)) {
         badFieldCountError();
       }
       buffer.add(")");
diff --git a/lib/compiler/implementation/js_backend/emitter.dart b/lib/compiler/implementation/js_backend/emitter.dart
index 518cf82..ad1d1fa 100644
--- a/lib/compiler/implementation/js_backend/emitter.dart
+++ b/lib/compiler/implementation/js_backend/emitter.dart
@@ -47,13 +47,11 @@
 
   final bool generateSourceMap;
 
-  CodeEmitterTask(Compiler compiler, Namer namer,
-                  [bool generateSourceMap = false])
+  CodeEmitterTask(Compiler compiler, Namer namer, this.generateSourceMap)
       : boundClosureBuffer = new CodeBuffer(),
         mainBuffer = new CodeBuffer(),
         this.namer = namer,
         boundClosureCache = new Map<int, String>(),
-        generateSourceMap = generateSourceMap,
         constantEmitter = new ConstantEmitter(compiler, namer),
         super(compiler) {
     nativeEmitter = new NativeEmitter(this);
@@ -68,7 +66,7 @@
   }
 
   void writeConstantToBuffer(Constant value, CodeBuffer buffer,
-                             [emitCanonicalVersion = true]) {
+                             {emitCanonicalVersion: true}) {
     if (emitCanonicalVersion) {
       constantEmitter.emitCanonicalVersionOfConstant(value, buffer);
     } else {
@@ -165,6 +163,8 @@
     // On Firefox and Webkit browsers we can manipulate the __proto__
     // directly. Opera claims to have __proto__ support, but it is buggy.
     // So we have to do more checks.
+    // Opera bug was filed as DSK-370158, and fixed as CORE-47615
+    // (http://my.opera.com/desktopteam/blog/2012/07/20/more-12-01-fixes).
     // If the browser does not support __proto__ we need to instantiate an
     // object with the correct (internal) prototype set up correctly, and then
     // copy the members.
@@ -605,7 +605,7 @@
       if (codeBuffer == null) return;
       defineInstanceMember(namer.getName(member), codeBuffer);
       codeBuffer = compiler.codegenWorld.generatedBailoutCode[member];
-      if (codeBuffer !== null) {
+      if (codeBuffer != null) {
         defineInstanceMember(namer.getBailoutName(member), codeBuffer);
       }
       FunctionElement function = member;
@@ -620,107 +620,6 @@
     emitExtraAccessors(member, defineInstanceMember);
   }
 
-  String generateCheckedSetter(Element member, String fieldName) {
-    DartType type = member.computeType(compiler);
-    if (type.element.isTypeVariable()
-        || type.element == compiler.dynamicClass
-        || type.element == compiler.objectClass) {
-      // TODO(ngeoffray): Support type checks on type parameters.
-      return null;
-    } else {
-      SourceString helper = compiler.backend.getCheckedModeHelper(type);
-      FunctionElement helperElement = compiler.findHelper(helper);
-      String helperName = namer.isolateAccess(helperElement);
-      String additionalArgument = '';
-      if (helperElement.computeSignature(compiler).parameterCount != 1) {
-        additionalArgument = ", '${namer.operatorIs(type.element)}'";
-      }
-      return " set\$$fieldName: function(v) { "
-          "this.$fieldName = $helperName(v$additionalArgument); }";
-    }
-  }
-
-  /**
-   * Documentation wanted -- johnniwinther
-   *
-   * Invariant: [classElement] must be a declaration element.
-   */
-  List<String> emitClassFields(ClassElement classElement, CodeBuffer buffer) {
-    assert(invariant(classElement, classElement.isDeclaration));
-    // If the class is never instantiated we still need to set it up for
-    // inheritance purposes, but we can simplify its JavaScript constructor.
-    bool isInstantiated =
-        compiler.codegenWorld.instantiatedClasses.contains(classElement);
-    List<String> checkedSetters = <String>[];
-
-    bool isFirstField = true;
-    void addField(ClassElement enclosingClass, Element member) {
-      assert(!member.isNative());
-      assert(invariant(classElement, member.isDeclaration));
-
-      LibraryElement library = member.getLibrary();
-      SourceString name = member.name;
-      bool isPrivate = name.isPrivate();
-      // See if we can dynamically create getters and setters.
-      // We can only generate getters and setters for [classElement] since
-      // the fields of super classes could be overwritten with getters or
-      // setters.
-      bool needsDynamicGetter = false;
-      bool needsDynamicSetter = false;
-      // We need to name shadowed fields differently, so they don't clash with
-      // the non-shadowed field.
-      bool isShadowed = false;
-      if (enclosingClass === classElement) {
-        needsDynamicGetter = instanceFieldNeedsGetter(member);
-        needsDynamicSetter = instanceFieldNeedsSetter(member);
-      } else {
-        isShadowed = classElement.isShadowedByField(member);
-      }
-
-      if ((isInstantiated && !enclosingClass.isNative())
-          || needsDynamicGetter
-          || needsDynamicSetter) {
-        if (isFirstField) {
-          isFirstField = false;
-        } else {
-          buffer.add(", ");
-        }
-        String fieldName = isShadowed
-            ? namer.shadowedFieldName(member)
-            : namer.getName(member);
-        if (needsDynamicSetter && compiler.enableTypeAssertions) {
-          String setter = generateCheckedSetter(member, fieldName);
-          if (setter != null) {
-            needsDynamicSetter = false;
-            checkedSetters.add(setter);
-          }
-        }
-        // Getters and setters with suffixes will be generated dynamically.
-        buffer.add('"$fieldName');
-        if (needsDynamicGetter || needsDynamicSetter) {
-          if (needsDynamicGetter && needsDynamicSetter) {
-            buffer.add(GETTER_SETTER_SUFFIX);
-          } else if (needsDynamicGetter) {
-            buffer.add(GETTER_SUFFIX);
-          } else {
-            buffer.add(SETTER_SUFFIX);
-          }
-        }
-        buffer.add('"');
-      }
-    }
-
-    // If a class is not instantiated then we add the field just so we can
-    // generate the field getter/setter dynamically. Since this is only
-    // allowed on fields that are in [classElement] we don't need to visit
-    // superclasses for non-instantiated classes.
-    classElement.implementation.forEachInstanceField(
-        addField,
-        includeBackendMembers: true,
-        includeSuperMembers: isInstantiated && !classElement.isNative());
-    return checkedSetters;
-  }
-
   /**
    * Documentation wanted -- johnniwinther
    *
@@ -739,13 +638,14 @@
       buffer.add(memberBuffer);
     }
 
-    classElement.implementation.forEachMember(includeBackendMembers: true,
-        f: (ClassElement enclosing, Element member) {
-      assert(invariant(classElement, member.isDeclaration));
-      if (member.isInstanceMember()) {
-        addInstanceMember(member, defineInstanceMember);
-      }
-    });
+    classElement.implementation.forEachMember(
+        (ClassElement enclosing, Element member) {
+          assert(invariant(classElement, member.isDeclaration));
+          if (member.isInstanceMember()) {
+            addInstanceMember(member, defineInstanceMember);
+          }
+        },
+        includeBackendMembers: true);
 
     generateIsTestsOn(classElement, (ClassElement other) {
       String code;
@@ -760,7 +660,8 @@
       defineInstanceMember(namer.operatorIs(other), typeTestBuffer);
     });
 
-    if (classElement === compiler.objectClass && compiler.enabledNoSuchMethod) {
+    if (identical(classElement, compiler.objectClass)
+        && compiler.enabledNoSuchMethod) {
       // Emit the noSuchMethod handlers on the Object prototype now,
       // so that the code in the dynamicFunction helper can find
       // them. Note that this helper is invoked before analyzing the
@@ -776,6 +677,165 @@
    *
    * Invariant: [classElement] must be a declaration element.
    */
+  void visitClassFields(ClassElement classElement,
+                        void addField(Element member,
+                                      String name,
+                                      bool needsGetter,
+                                      bool needsSetter,
+                                      bool needsCheckedSetter)) {
+    assert(invariant(classElement, classElement.isDeclaration));
+    // If the class is never instantiated we still need to set it up for
+    // inheritance purposes, but we can simplify its JavaScript constructor.
+    bool isInstantiated =
+        compiler.codegenWorld.instantiatedClasses.contains(classElement);
+
+    void visitField(ClassElement enclosingClass, Element member) {
+      assert(!member.isNative());
+      assert(invariant(classElement, member.isDeclaration));
+
+      LibraryElement library = member.getLibrary();
+      SourceString name = member.name;
+      bool isPrivate = name.isPrivate();
+      // See if we can dynamically create getters and setters.
+      // We can only generate getters and setters for [classElement] since
+      // the fields of super classes could be overwritten with getters or
+      // setters.
+      bool needsGetter = false;
+      bool needsSetter = false;
+      // We need to name shadowed fields differently, so they don't clash with
+      // the non-shadowed field.
+      bool isShadowed = false;
+      if (identical(enclosingClass, classElement)) {
+        needsGetter = instanceFieldNeedsGetter(member);
+        needsSetter = instanceFieldNeedsSetter(member);
+      } else {
+        isShadowed = classElement.isShadowedByField(member);
+      }
+
+      if ((isInstantiated && !enclosingClass.isNative())
+          || needsGetter
+          || needsSetter) {
+        String fieldName = isShadowed
+            ? namer.shadowedFieldName(member)
+            : namer.getName(member);
+        bool needsCheckedSetter = false;
+        if (needsSetter && compiler.enableTypeAssertions
+            && canGenerateCheckedSetter(member)) {
+          needsCheckedSetter = true;
+          needsSetter = false;
+        }
+        // Getters and setters with suffixes will be generated dynamically.
+        addField(member,
+                 fieldName,
+                 needsGetter,
+                 needsSetter,
+                 needsCheckedSetter);
+      }
+    }
+
+    // If a class is not instantiated then we add the field just so we can
+    // generate the field getter/setter dynamically. Since this is only
+    // allowed on fields that are in [classElement] we don't need to visit
+    // superclasses for non-instantiated classes.
+    classElement.implementation.forEachInstanceField(
+        visitField,
+        includeBackendMembers: true,
+        includeSuperMembers: isInstantiated && !classElement.isNative());
+  }
+
+  void generateGetter(Element member, String fieldName, CodeBuffer buffer) {
+    String getterName = namer.getterName(member.getLibrary(), member.name);
+    buffer.add("$getterName: function() { return this.$fieldName; }");
+  }
+
+  void generateSetter(Element member, String fieldName, CodeBuffer buffer) {
+    String setterName = namer.setterName(member.getLibrary(), member.name);
+    buffer.add("$setterName: function(v) { this.$fieldName = v; }");
+  }
+
+  bool canGenerateCheckedSetter(Element member) {
+    DartType type = member.computeType(compiler);
+    if (type.element.isTypeVariable()
+        || type.element == compiler.dynamicClass
+        || type.element == compiler.objectClass) {
+      // TODO(ngeoffray): Support type checks on type parameters.
+      return false;
+    }
+    return true;
+  }
+
+  void generateCheckedSetter(Element member,
+                             String fieldName,
+                             CodeBuffer buffer) {
+    assert(canGenerateCheckedSetter(member));
+    DartType type = member.computeType(compiler);
+    SourceString helper = compiler.backend.getCheckedModeHelper(type);
+    FunctionElement helperElement = compiler.findHelper(helper);
+    String helperName = namer.isolateAccess(helperElement);
+    String additionalArgument = '';
+    if (helperElement.computeSignature(compiler).parameterCount != 1) {
+      additionalArgument = ", '${namer.operatorIs(type.element)}'";
+    }
+    String setterName = namer.setterName(member.getLibrary(), member.name);
+    buffer.add("$setterName: function(v) { "
+        "this.$fieldName = $helperName(v$additionalArgument); }");
+  }
+
+  void emitClassConstructor(ClassElement classElement, CodeBuffer buffer) {
+    /* Do nothing. */
+  }
+
+  void emitClassFields(ClassElement classElement, CodeBuffer buffer) {
+    buffer.add('"": [');
+    bool isFirstField = true;
+    visitClassFields(classElement, (Element member,
+                                    String name,
+                                    bool needsGetter,
+                                    bool needsSetter,
+                                    bool needsCheckedSetter) {
+      if (isFirstField) {
+        isFirstField = false;
+      } else {
+        buffer.add(", ");
+      }
+      buffer.add('"$name');
+      if (needsGetter && needsSetter) {
+        buffer.add(GETTER_SETTER_SUFFIX);
+      } else if (needsGetter) {
+        buffer.add(GETTER_SUFFIX);
+      } else if (needsSetter) {
+        buffer.add(SETTER_SUFFIX);
+      }
+      buffer.add('"');
+    });
+    buffer.add(']');
+  }
+
+  /** Each getter/setter must be prefixed with a ",\n ". */
+  void emitClassGettersSetters(ClassElement classElement, CodeBuffer buffer,
+                               {bool omitLeadingComma: false}) {
+    visitClassFields(classElement, (Element member,
+                                    String name,
+                                    bool needsGetter,
+                                    bool needsSetter,
+                                    bool needsCheckedSetter) {
+      if (needsCheckedSetter) {
+        assert(!needsSetter);
+        if (!omitLeadingComma) {
+          buffer.add(",\n ");
+        } else {
+          omitLeadingComma = false;
+        }
+        generateCheckedSetter(member, name, buffer);
+      }
+    });
+  }
+
+  /**
+   * Documentation wanted -- johnniwinther
+   *
+   * Invariant: [classElement] must be a declaration element.
+   */
   void generateClass(ClassElement classElement, CodeBuffer buffer) {
     assert(invariant(classElement, classElement.isDeclaration));
     if (classElement.isNative()) {
@@ -792,23 +852,18 @@
     String className = namer.getName(classElement);
     ClassElement superclass = classElement.superclass;
     String superName = "";
-    if (superclass !== null) {
+    if (superclass != null) {
       superName = namer.getName(superclass);
     }
-    String constructorName = namer.safeName(classElement.name.slowToString());
 
-    buffer.add('$classesCollector.$className = {"":\n');
-    buffer.add(' [');
-    List<String> checkedSetters = emitClassFields(classElement, buffer);
-    buffer.add('],\n');
+    buffer.add('$classesCollector.$className = {');
+    emitClassConstructor(classElement, buffer);
+    emitClassFields(classElement, buffer);
     // TODO(floitsch): the emitInstanceMember should simply always emit a ',\n'.
     // That does currently not work because the native classes have a different
     // syntax.
-    buffer.add(' "super": "$superName"');
-    if (!checkedSetters.isEmpty()) {
-      buffer.add(',\n');
-      buffer.add('${Strings.join(checkedSetters, ",\n")}');
-    }
+    buffer.add(',\n "super": "$superName"');
+    emitClassGettersSetters(classElement, buffer);
     emitInstanceMembers(classElement, buffer, true);
     buffer.add('\n};\n\n');
   }
@@ -868,7 +923,7 @@
         new Set<ClassElement>.from(instantiatedClasses);
     for (ClassElement element in instantiatedClasses) {
       for (ClassElement superclass = element.superclass;
-           superclass !== null;
+           superclass != null;
            superclass = superclass.superclass) {
         if (neededClasses.contains(superclass)) break;
         neededClasses.add(superclass);
@@ -892,7 +947,7 @@
       for (ClassElement element in sortedClasses) {
         if (!element.isNative()) continue;
         Element member = element.lookupLocalMember(noSuchMethodName);
-        if (member === null) continue;
+        if (member == null) continue;
         if (noSuchMethodSelector.applies(member, compiler)) {
           nativeEmitter.handleNoSuchMethod = true;
           break;
@@ -973,6 +1028,16 @@
     }
   }
 
+  void emitBoundClosureClassHeader(String mangledName,
+                             String superName,
+                             CodeBuffer buffer) {
+    buffer.add("""
+$classesCollector.$mangledName = {'':
+['self', 'target'],
+'super': '$superName',
+""");
+  }
+
   /**
    * Documentation wanted -- johnniwinther
    *
@@ -1007,7 +1072,7 @@
 
     String closureClass =
         hasOptionalParameters ? null : boundClosureCache[parameterCount];
-    if (closureClass === null) {
+    if (closureClass == null) {
       // Either the class was not cached yet, or there are optional parameters.
       // Create a new closure class.
       SourceString name = const SourceString("BoundClosure");
@@ -1019,11 +1084,7 @@
 
       // Define the constructor with a name so that Object.toString can
       // find the class name of the closure class.
-      boundClosureBuffer.add("""
-$classesCollector.$mangledName = {'':
- ['self', 'target'],
- 'super': '$superName',
-""");
+      emitBoundClosureClassHeader(mangledName, superName, boundClosureBuffer);
       // Now add the methods on the closure class. The instance method does not
       // have the correct name. Since [addParameterStubs] use the name to create
       // its stubs we simply create a fake element with the correct name.
@@ -1123,7 +1184,7 @@
     if (!lazyFields.isEmpty()) {
       needsLazyInitializer = true;
       for (VariableElement element in lazyFields) {
-        assert(compiler.codegenWorld.generatedBailoutCode[element] === null);
+        assert(compiler.codegenWorld.generatedBailoutCode[element] == null);
         StringBuffer code = compiler.codegenWorld.generatedCode[element];
         assert(code != null);
         // The code only computes the initial value. We build the lazy-check
@@ -1158,7 +1219,7 @@
       // The name is null when the constant is already a JS constant.
       // TODO(floitsch): every constant should be registered, so that we can
       // share the ones that take up too much space (like some strings).
-      if (name === null) continue;
+      if (name == null) continue;
       if (!addedMakeConstantList && constant.isList()) {
         addedMakeConstantList = true;
         emitMakeConstantList(buffer);
@@ -1189,7 +1250,7 @@
     assert(invariant(member, member.isDeclaration));
     if (member.isGetter() || member.isField()) {
       Set<Selector> selectors = compiler.codegenWorld.invokedNames[member.name];
-      if (selectors !== null && !selectors.isEmpty()) {
+      if (selectors != null && !selectors.isEmpty()) {
         emitCallStubForGetter(member, selectors, defineInstanceMember);
       }
     } else if (member.isFunction()) {
@@ -1217,7 +1278,7 @@
     Set<ClassElement> noSuchMethodHoldersFor(DartType type) {
       ClassElement element = type.element;
       Set<ClassElement> result = noSuchMethodHolders[element];
-      if (result === null) {
+      if (result == null) {
         // For now, we check the entire world to see if an object of
         // the given type may have a user-defined noSuchMethod
         // implementation. We could do better by only looking at
@@ -1252,16 +1313,16 @@
         // selector (grabbed from the scope).
         bool hasMatchingMember(ClassElement holder) {
           Element element = holder.lookupMember(selector.name);
-          if (element === null) return false;
+          if (element == null) return false;
 
           // TODO(kasperl): Consider folding this logic into the
           // Selector.applies() method.
           if (element is AbstractFieldElement) {
             AbstractFieldElement field = element;
-            if (selector.kind === SelectorKind.GETTER) {
-              return field.getter !== null;
-            } else if (selector.kind === SelectorKind.SETTER) {
-              return field.setter !== null;
+            if (identical(selector.kind, SelectorKind.GETTER)) {
+              return field.getter != null;
+            } else if (identical(selector.kind, SelectorKind.SETTER)) {
+              return field.setter != null;
             } else {
               return false;
             }
@@ -1373,6 +1434,9 @@
 
     // TODO(ngeoffray): These globals are currently required by the isolate
     // library. They should be removed.
+    String runtimeTypeCache =
+        compiler.enabledRuntimeType ? "  context.runtimeTypeCache = {}\n" : "";
+
     buffer.add("""
 var \$globalThis = $currentIsolate;
 var \$globalState;
@@ -1384,7 +1448,7 @@
 
 function \$initGlobals(context) {
   context.isolateStatics = new ${namer.ISOLATE}();
-}
+$runtimeTypeCache}
 function \$setGlobals(context) {
   $currentIsolate = context.isolateStatics;
   \$globalThis = $currentIsolate;
@@ -1459,7 +1523,7 @@
       // constants to be set up.
       emitStaticNonFinalFieldInitializations(mainBuffer);
       emitLazilyInitializedStaticFields(mainBuffer);
-      if (compiler.enabledRuntimeType) {
+      if (compiler.enabledRuntimeType && !compiler.hasIsolateSupport()) {
         mainBuffer.add('$isolateProperties.runtimeTypeCache = {};\n');
       }
 
diff --git a/lib/compiler/implementation/js_backend/emitter_no_eval.dart b/lib/compiler/implementation/js_backend/emitter_no_eval.dart
new file mode 100644
index 0000000..f658c93
--- /dev/null
+++ b/lib/compiler/implementation/js_backend/emitter_no_eval.dart
@@ -0,0 +1,142 @@
+// Copyright (c) 2012, 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 CodeEmitterNoEvalTask extends CodeEmitterTask {
+  CodeEmitterNoEvalTask(Compiler compiler,
+                        Namer namer,
+                        bool generateSourceMap)
+      : super(compiler, namer, generateSourceMap);
+
+  String get generateGetterSetterFunction {
+    return """
+function() {
+  throw 'Internal Error: no dynamic generation of getters and setters allowed';
+}""";
+  }
+
+  String get defineClassFunction {
+    return """
+function(cls, constructor, prototype) {
+  constructor.prototype = prototype;
+  return constructor;
+}""";
+  }
+
+  String get protoSupportCheck {
+    // We don't modify the prototypes in CSP mode. Therefore we can have an
+    // easier prototype-check.
+    return 'var $supportsProtoName = !!{}.__proto__;\n';
+  }
+
+  String get finishIsolateConstructorFunction {
+    // We replace the old Isolate function with a new one that initializes
+    // all its field with the initial (and often final) value of all globals.
+    //
+    // We also copy over old values like the prototype, and the
+    // isolateProperties themselves.
+    return """
+function(oldIsolate) {
+  var isolateProperties = oldIsolate.${namer.ISOLATE_PROPERTIES};
+  function Isolate() {
+    for (var staticName in isolateProperties) {
+      if (Object.prototype.hasOwnProperty.call(isolateProperties, staticName)) {
+        this[staticName] = isolateProperties[staticName];
+      }
+    }
+    // Use the newly created object as prototype. In Chrome this creates a
+    // hidden class for the object and makes sure it is fast to access.
+    function ForceEfficientMap() {}
+    ForceEfficientMap.prototype = this;
+    new ForceEfficientMap;
+  }
+  Isolate.prototype = oldIsolate.prototype;
+  Isolate.prototype.constructor = Isolate;
+  Isolate.${namer.ISOLATE_PROPERTIES} = isolateProperties;
+  return Isolate;
+}""";
+  }
+
+  void emitBoundClosureClassHeader(String mangledName,
+                                   String superName,
+                                   CodeBuffer buffer) {
+    buffer.add("""
+$classesCollector.$mangledName = {'': function $mangledName(self, target) {
+  this.self = self;
+  this.target = target;
+ },
+ 'super': '$superName',
+""");
+  }
+
+  void emitClassConstructor(ClassElement classElement, CodeBuffer buffer) {
+    // Say we have a class A with fields b, c and d, where c needs a getter and
+    // d needs both a getter and a setter. Then we produce:
+    // - a constructor (directly into the given [buffer]):
+    //   function A(b, c, d) { this.b = b, this.c = c, this.d = d; }
+    // - getters and setters (stored in the [explicitGettersSetters] list):
+    //   get$c : function() { return this.c; }
+    //   get$d : function() { return this.d; }
+    //   set$d : function(x) { this.d = x; }
+    List<String> fields = <String>[];
+    visitClassFields(classElement, (Element member,
+                                    String name,
+                                    bool needsGetter,
+                                    bool needsSetter,
+                                    bool needsCheckedSetter) {
+      fields.add(name);
+    });
+
+    List<String> argumentNames = fields;
+    if (fields.length < ($z - $a)) {
+      argumentNames = new List<String>(fields.length);
+      for (int i = 0; i < fields.length; i++) {
+        argumentNames[i] = new String.fromCharCodes([$a + i]);
+      }
+    }
+    String constructorName = namer.safeName(classElement.name.slowToString());
+    // Generate the constructor.
+    buffer.add("'': function $constructorName(");
+    buffer.add(Strings.join(argumentNames, ", "));
+    buffer.add(") {\n");
+    for (int i = 0; i < fields.length; i++) {
+      buffer.add("  this.${fields[i]} = ${argumentNames[i]};\n");
+    }
+    buffer.add(' }');
+  }
+
+  void emitClassFields(ClassElement classElement, CodeBuffer buffer) {
+    /* Do nothing. */
+  }
+
+  void emitClassGettersSetters(ClassElement classElement, CodeBuffer buffer,
+                               {bool omitLeadingComma: false}) {
+    emitComma() {
+      if (!omitLeadingComma) {
+        buffer.add(",\n ");
+      } else {
+        omitLeadingComma = false;
+      }
+    }
+
+    visitClassFields(classElement, (Element member,
+                                    String name,
+                                    bool needsGetter,
+                                    bool needsSetter,
+                                    bool needsCheckedSetter) {
+      if (needsGetter) {
+        emitComma();
+        generateGetter(member, name, buffer);
+      }
+      if (needsSetter) {
+        emitComma();
+        generateSetter(member, name, buffer);
+      }
+      if (needsCheckedSetter) {
+        assert(!needsSetter);
+        emitComma();
+        generateCheckedSetter(member, name, buffer);
+      }
+    });
+  }
+}
diff --git a/lib/compiler/implementation/js_backend/js_backend.dart b/lib/compiler/implementation/js_backend/js_backend.dart
index 844a607..3085bf2 100644
--- a/lib/compiler/implementation/js_backend/js_backend.dart
+++ b/lib/compiler/implementation/js_backend/js_backend.dart
@@ -2,25 +2,25 @@
 // 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('js_backend');
+library js_backend;
 
-#import('../closure.dart');
-#import('../../compiler.dart', prefix: 'api');
-#import('../elements/elements.dart');
-#import('../leg.dart');
-#import('../native_handler.dart', prefix: 'native');
-#import('../scanner/scannerlib.dart');
-#import('../source_file.dart');
-#import('../source_map_builder.dart');
-#import('../ssa/ssa.dart');
-#import('../tree/tree.dart');
-#import('../universe/universe.dart');
-#import('../util/characters.dart');
-#import('../util/util.dart');
+import '../closure.dart';
+import '../../compiler.dart' as api;
+import '../elements/elements.dart';
+import '../dart2jslib.dart' hide Selector;
+import '../native_handler.dart' as native;
+import '../source_file.dart';
+import '../source_map_builder.dart';
+import '../ssa/ssa.dart';
+import '../tree/tree.dart';
+import '../universe/universe.dart';
+import '../util/characters.dart';
+import '../util/util.dart';
 
-#source('backend.dart');
-#source('constant_emitter.dart');
-#source('constant_system_javascript.dart');
-#source('emitter.dart');
-#source('namer.dart');
-#source('native_emitter.dart');
+part 'backend.dart';
+part 'constant_emitter.dart';
+part 'constant_system_javascript.dart';
+part 'emitter.dart';
+part 'emitter_no_eval.dart';
+part 'namer.dart';
+part 'native_emitter.dart';
diff --git a/lib/compiler/implementation/js_backend/namer.dart b/lib/compiler/implementation/js_backend/namer.dart
index a5ec408..21c46c3 100644
--- a/lib/compiler/implementation/js_backend/namer.dart
+++ b/lib/compiler/implementation/js_backend/namer.dart
@@ -10,7 +10,7 @@
 
   static Set<String> _jsReserved = null;
   Set<String> get jsReserved {
-    if (_jsReserved === null) {
+    if (_jsReserved == null) {
       _jsReserved = new Set<String>();
       _jsReserved.addAll(JsNames.javaScriptKeywords);
       _jsReserved.addAll(JsNames.reservedPropertySymbols);
@@ -51,7 +51,7 @@
     // constant and can be accessed directly.
     assert(!constant.isFunction());
     String result = constantNames[constant];
-    if (result === null) {
+    if (result == null) {
       result = getFreshGlobalName("CTC");
       constantNames[constant] = result;
     }
@@ -91,7 +91,7 @@
       // If a private name could clash with a mangled private name we don't
       // use the short name. For example a private name "_lib3_foo" would
       // clash with "_foo" from "lib3".
-      if (owner === lib && !nameString.startsWith('_$LIBRARY_PREFIX')) {
+      if (identical(owner, lib) && !nameString.startsWith('_$LIBRARY_PREFIX')) {
         return nameString;
       }
       String libName = getName(lib);
@@ -173,11 +173,11 @@
   String getFreshGlobalName(String proposedName) {
     String name = proposedName;
     int count = usedGlobals[name];
-    if (count !== null) {
+    if (count != null) {
       // Not the first time we see this name. Append a number to make it unique.
       do {
         name = '$proposedName${count++}';
-      } while (usedGlobals[name] !== null);
+      } while (usedGlobals[name] != null);
       // Record the count in case we see this name later. We
       // frequently see names multiple times, as all our closures use
       // the same name for their class.
@@ -212,7 +212,7 @@
       } else {
         name = element.name.slowToString();
       }
-    } else if (element.kind === ElementKind.LIBRARY) {
+    } else if (identical(element.kind, ElementKind.LIBRARY)) {
       name = LIBRARY_PREFIX;
     } else {
       name = element.name.slowToString();
@@ -254,23 +254,23 @@
 
       // Dealing with a top-level or static element.
       String cached = globals[element];
-      if (cached !== null) return cached;
+      if (cached != null) return cached;
 
       String guess = _computeGuess(element);
       ElementKind kind = element.kind;
-      if (kind === ElementKind.VARIABLE ||
-          kind === ElementKind.PARAMETER) {
+      if (identical(kind, ElementKind.VARIABLE) ||
+          identical(kind, ElementKind.PARAMETER)) {
         // The name is not guaranteed to be unique.
         return guess;
       }
-      if (kind === ElementKind.GENERATIVE_CONSTRUCTOR ||
-          kind === ElementKind.FUNCTION ||
-          kind === ElementKind.CLASS ||
-          kind === ElementKind.FIELD ||
-          kind === ElementKind.GETTER ||
-          kind === ElementKind.SETTER ||
-          kind === ElementKind.TYPEDEF ||
-          kind === ElementKind.LIBRARY) {
+      if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR) ||
+          identical(kind, ElementKind.FUNCTION) ||
+          identical(kind, ElementKind.CLASS) ||
+          identical(kind, ElementKind.FIELD) ||
+          identical(kind, ElementKind.GETTER) ||
+          identical(kind, ElementKind.SETTER) ||
+          identical(kind, ElementKind.TYPEDEF) ||
+          identical(kind, ElementKind.LIBRARY)) {
         String result = getFreshGlobalName(guess);
         globals[element] = result;
         return result;
diff --git a/lib/compiler/implementation/js_backend/native_emitter.dart b/lib/compiler/implementation/js_backend/native_emitter.dart
index 065a43d3..d4321b2 100644
--- a/lib/compiler/implementation/js_backend/native_emitter.dart
+++ b/lib/compiler/implementation/js_backend/native_emitter.dart
@@ -95,13 +95,19 @@
 
   String get defineNativeClassFunction {
     return """
-function(cls, fields, methods) {
+function(cls, desc) {
+  var fields = desc[''] || [];
   var generateGetterSetter = ${emitter.generateGetterSetterFunction};
   for (var i = 0; i < fields.length; i++) {
-    generateGetterSetter(fields[i], methods);
+    generateGetterSetter(fields[i], desc);
   }
-  for (var method in methods) {
-    $dynamicName(method)[cls] = methods[method];
+  var hasOwnProperty = Object.prototype.hasOwnProperty;
+  for (var method in desc) {
+    if (method !== '') {
+      if (hasOwnProperty.call(desc, method)) {
+        $dynamicName(method)[cls] = desc[method];
+      }
+    }
   }
 }""";
   }
@@ -127,11 +133,11 @@
   }
 
   bool isNativeLiteral(String quotedName) {
-    return quotedName[1] === '=';
+    return identical(quotedName[1], '=');
   }
 
   bool isNativeGlobal(String quotedName) {
-    return quotedName[1] === '@';
+    return identical(quotedName[1], '@');
   }
 
   String toNativeName(ClassElement cls) {
@@ -157,23 +163,39 @@
     }
 
     CodeBuffer fieldBuffer = new CodeBuffer();
-    List<String> checkedSetters =
-        emitter.emitClassFields(classElement, fieldBuffer);
+    CodeBuffer getterSetterBuffer = new CodeBuffer();
+
+    emitter.emitClassFields(classElement, fieldBuffer);
+    emitter.emitClassGettersSetters(classElement, getterSetterBuffer,
+                                    omitLeadingComma: true);
 
     CodeBuffer methodBuffer = new CodeBuffer();
     emitter.emitInstanceMembers(classElement, methodBuffer, false);
 
-    if (methodBuffer.isEmpty() && fieldBuffer.isEmpty()) return;
+    if (methodBuffer.isEmpty()
+        && fieldBuffer.isEmpty()
+        && getterSetterBuffer.isEmpty()) {
+      return;
+    }
 
     String nativeName = toNativeName(classElement);
-    nativeBuffer.add("$defineNativeClassName('$nativeName', [");
-    nativeBuffer.add(fieldBuffer);
-    nativeBuffer.add('], {');
-    if (!checkedSetters.isEmpty()) {
-      nativeBuffer.add('${Strings.join(checkedSetters, ",\n")}');
-      nativeBuffer.add(',\n');
+    nativeBuffer.add("$defineNativeClassName('$nativeName', ");
+    nativeBuffer.add('{');
+    bool firstInMap = true;
+    if (!fieldBuffer.isEmpty()) {
+      firstInMap = false;
+      nativeBuffer.add(fieldBuffer);
     }
-    nativeBuffer.add(methodBuffer);
+    if (!getterSetterBuffer.isEmpty()) {
+      if (!firstInMap) nativeBuffer.add(",");
+      firstInMap = false;
+      nativeBuffer.add("\n ");
+      nativeBuffer.add(getterSetterBuffer);
+    }
+    if (!methodBuffer.isEmpty()) {
+      if (!firstInMap) nativeBuffer.add(",");
+      nativeBuffer.add(methodBuffer);
+    }
     nativeBuffer.add('\n});\n\n');
 
     classesWithDynamicDispatch.add(classElement);
@@ -181,7 +203,7 @@
 
   List<ClassElement> getDirectSubclasses(ClassElement cls) {
     List<ClassElement> result = directSubtypes[cls];
-    return result === null ? const<ClassElement>[] : result;
+    return result == null ? const<ClassElement>[] : result;
   }
 
   void potentiallyConvertDartClosuresToJs(CodeBuffer code,
@@ -239,7 +261,7 @@
     } else {
       // When calling a JS method, we call it with the native name.
       String name = redirectingMethods[member];
-      if (name === null) name = member.name.slowToString();
+      if (name == null) name = member.name.slowToString();
       code.add('  return this.$name($nativeArguments);');
     }
 
@@ -384,7 +406,7 @@
       return false;
     }
 
-    return subtypes[element] !== null;
+    return subtypes[element] != null;
   }
 
   bool requiresNativeIsCheck(Element element) {
@@ -454,7 +476,7 @@
       });
       targetBuffer.add("\n});\n\n");
     }
-    targetBuffer.add('$nativeBuffer');
+    targetBuffer.add(nativeBuffer);
     targetBuffer.add('\n');
   }
 }
diff --git a/lib/compiler/implementation/leg.dart b/lib/compiler/implementation/leg.dart
deleted file mode 100644
index a4c8ee2..0000000
--- a/lib/compiler/implementation/leg.dart
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012, 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('leg');
-
-#import('dart:uri');
-
-#import('closure.dart', prefix: 'closureMapping');
-#import('dart_backend/dart_backend.dart', prefix: 'dart_backend');
-#import('elements/elements.dart');
-#import('js_backend/js_backend.dart', prefix: 'js_backend');
-#import('native_handler.dart', prefix: 'native');
-#import('scanner/scanner_implementation.dart');
-#import('scanner/scannerlib.dart');
-#import('ssa/ssa.dart');
-#import('string_validator.dart');
-#import('source_file.dart');
-#import('tree/tree.dart');
-#import('universe/universe.dart');
-#import('util/characters.dart');
-#import('util/util.dart');
-#import('../compiler.dart', prefix: 'api');
-#import('patch_parser.dart');
-#import('types/types.dart', prefix: 'ti');
-
-#source('code_buffer.dart');
-#source('compile_time_constants.dart');
-#source('compiler.dart');
-#source('constants.dart');
-#source('constant_system.dart');
-#source('constant_system_dart.dart');
-#source('diagnostic_listener.dart');
-#source('enqueue.dart');
-#source('library_loader.dart');
-#source('resolved_visitor.dart');
-#source('resolver.dart');
-#source('script.dart');
-#source('tree_validator.dart');
-#source('typechecker.dart');
-#source('warnings.dart');
-#source('world.dart');
diff --git a/lib/compiler/implementation/lib/core_patch.dart b/lib/compiler/implementation/lib/core_patch.dart
index df6fe51..9641920 100644
--- a/lib/compiler/implementation/lib/core_patch.dart
+++ b/lib/compiler/implementation/lib/core_patch.dart
@@ -45,12 +45,12 @@
 
   patch T operator[](Object object) {
     var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    return (values === null) ? null : Primitives.getProperty(values, _getKey());
+    return (values == null) ? null : Primitives.getProperty(values, _getKey());
   }
 
   patch void operator[]=(Object object, T value) {
     var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME);
-    if (values === null) {
+    if (values == null) {
       values = new Object();
       Primitives.setProperty(object, _EXPANDO_PROPERTY_NAME, values);
     }
@@ -59,7 +59,7 @@
 
   String _getKey() {
     String key = Primitives.getProperty(this, _KEY_PROPERTY_NAME);
-    if (key === null) {
+    if (key == null) {
       key = "expando\$key\$${_keyCount++}";
       Primitives.setProperty(this, _KEY_PROPERTY_NAME, key);
     }
diff --git a/lib/compiler/implementation/lib/coreimpl_patch.dart b/lib/compiler/implementation/lib/coreimpl_patch.dart
index 124c48e..9b63064 100644
--- a/lib/compiler/implementation/lib/coreimpl_patch.dart
+++ b/lib/compiler/implementation/lib/coreimpl_patch.dart
@@ -74,13 +74,13 @@
 // in patch files?
 patch class DateImplementation {
   patch DateImplementation(int year,
-                           [int month = 1,
-                            int day = 1,
-                            int hour = 0,
-                            int minute = 0,
-                            int second = 0,
-                            int millisecond = 0,
-                            bool isUtc = false])
+                           int month,
+                           int day,
+                           int hour,
+                           int minute,
+                           int second,
+                           int millisecond,
+                           bool isUtc)
       : this.isUtc = checkNull(isUtc),
         millisecondsSinceEpoch = Primitives.valueFromDecomposedDate(
             year, month, day, hour, minute, second, millisecond, isUtc) {
@@ -154,7 +154,7 @@
 
   patch Match firstMatch(String str) {
     List<String> m = regExpExec(this, checkString(str));
-    if (m === null) return null;
+    if (m == null) return null;
     var matchStart = regExpMatchStart(m);
     // m.lastIndex only works with flag 'g'.
     var matchEnd = matchStart + m[0].length;
@@ -165,7 +165,7 @@
 
   patch String stringMatch(String str) {
     var match = firstMatch(str);
-    return match === null ? null : match.group(0);
+    return match == null ? null : match.group(0);
   }
 
   patch Iterable<Match> allMatches(String str) {
diff --git a/lib/compiler/implementation/lib/interceptors.dart b/lib/compiler/implementation/lib/interceptors.dart
index ffbd1d9..8aa6509 100644
--- a/lib/compiler/implementation/lib/interceptors.dart
+++ b/lib/compiler/implementation/lib/interceptors.dart
@@ -30,7 +30,7 @@
 removeLast(var receiver) {
   if (isJsArray(receiver)) {
     checkGrowable(receiver, 'removeLast');
-    if (receiver.length === 0) throw new IndexOutOfRangeException(-1);
+    if (receiver.length == 0) throw new IndexOutOfRangeException(-1);
     return JS('Object', r'#.pop()', receiver);
   }
   return UNINTERCEPTED(receiver.removeLast());
@@ -76,7 +76,7 @@
   if (JS('bool', r'# === 0 && (1 / #) < 0', value, value)) {
     return '-0.0';
   }
-  if (value === null) return 'null';
+  if (value == null) return 'null';
   if (JS('bool', r'typeof # == "function"', value)) {
     return 'Closure';
   }
@@ -190,7 +190,7 @@
   if (!isJsArray(receiver)) {
     return UNINTERCEPTED(receiver.getRange(start, length));
   }
-  if (0 === length) return [];
+  if (0 == length) return [];
   checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
   checkNull(length); // TODO(ahe): This is not specified but co19 tests it.
   if (start is !int) throw new ArgumentError(start);
@@ -271,7 +271,7 @@
   } else if (receiver is String) {
     checkNull(element);
     if (element is !String) throw new ArgumentError(element);
-    if (start !== null) {
+    if (start != null) {
       if (start is !num) throw new ArgumentError(start);
       if (start < 0) return -1;
       if (start >= receiver.length) {
@@ -325,7 +325,7 @@
   }
 
   checkMutable(receiver, 'indexed set');
-  if (length === 0) return;
+  if (length == 0) return;
   checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
   checkNull(length); // TODO(ahe): This is not specified but co19 tests it.
   checkNull(from); // TODO(ahe): This is not specified but co19 tests it.
@@ -358,16 +358,24 @@
   }
 }
 
-sort(receiver, compare) {
-  if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare));
+// TODO(ngeoffray): Make it possible to have just one "sort" function ends
+// an optional parameter.
 
+sort$0(receiver) {
+  if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort());
+  checkMutable(receiver, 'sort');
+  DualPivotQuicksort.sort(receiver, Comparable.compare);
+}
+
+sort$1(receiver, compare) {
+  if (!isJsArray(receiver)) return UNINTERCEPTED(receiver.sort(compare));
   checkMutable(receiver, 'sort');
   DualPivotQuicksort.sort(receiver, compare);
 }
 
 isNegative(receiver) {
   if (receiver is num) {
-    return (receiver === 0) ? (1 / receiver) < 0 : receiver < 0;
+    return (receiver == 0) ? (1 / receiver) < 0 : receiver < 0;
   } else {
     return UNINTERCEPTED(receiver.isNegative());
   }
@@ -463,7 +471,7 @@
     return UNINTERCEPTED(receiver.toStringAsExponential(fractionDigits));
   }
   String result;
-  if (fractionDigits !== null) {
+  if (fractionDigits != null) {
     checkNum(fractionDigits);
     result = JS('String', r'#.toExponential(#)', receiver, fractionDigits);
   } else {
@@ -508,10 +516,15 @@
 }
 
 contains$1(receiver, other) {
-  if (receiver is !String) {
-    return UNINTERCEPTED(receiver.contains(other));
+  if (receiver is String) {
+    return contains$2(receiver, other, 0);
+  } else if (isJsArray(receiver)) {
+    for (int i = 0; i < receiver.length; i++) {
+      if (other == receiver[i]) return true;
+    }
+    return false;
   }
-  return contains$2(receiver, other, 0);
+  return UNINTERCEPTED(receiver.contains(other));
 }
 
 contains$2(receiver, other, startIndex) {
@@ -581,7 +594,7 @@
   }
   checkNum(startIndex);
   var length = receiver.length;
-  if (endIndex === null) endIndex = length;
+  if (endIndex == null) endIndex = length;
   checkNum(endIndex);
   if (startIndex < 0 ) throw new IndexOutOfRangeException(startIndex);
   if (startIndex > endIndex) throw new IndexOutOfRangeException(startIndex);
@@ -616,7 +629,7 @@
 hashCode(receiver) {
   // TODO(ahe): This method shouldn't have to use JS. Update when our
   // optimizations are smarter.
-  if (receiver === null) return 0;
+  if (receiver == null) return 0;
   if (receiver is num) return JS('int', r'# & 0x1FFFFFFF', receiver);
   if (receiver is bool) return receiver ? 0x40377024 : 0xc18c0076;
   if (isJsArray(receiver)) return Primitives.objectHashCode(receiver);
@@ -645,12 +658,12 @@
 
 isEven(receiver) {
   if (receiver is !int) return UNINTERCEPTED(receiver.isEven());
-  return (receiver & 1) === 0;
+  return (receiver & 1) == 0;
 }
 
 isOdd(receiver) {
   if (receiver is !int) return UNINTERCEPTED(receiver.isOdd());
-  return (receiver & 1) === 1;
+  return (receiver & 1) == 1;
 }
 
 get$runtimeType(receiver) {
@@ -662,7 +675,7 @@
     return getOrCreateCachedRuntimeType('double');
   } else if (receiver is bool) {
     return getOrCreateCachedRuntimeType('bool');
-  } else if (receiver === null) {
+  } else if (receiver == null) {
     return getOrCreateCachedRuntimeType('Null');
   } else if (isJsArray(receiver)) {
     return getOrCreateCachedRuntimeType('List');
diff --git a/lib/compiler/implementation/lib/io.dart b/lib/compiler/implementation/lib/io.dart
index ee6559f..8d544b2 100644
--- a/lib/compiler/implementation/lib/io.dart
+++ b/lib/compiler/implementation/lib/io.dart
@@ -154,9 +154,9 @@
 }
 
 class _Process {
-  static Process start(String executable,
-                       List<String> arguments,
-                       [ProcessOptions options]) {
+  static Future<Process> start(String executable,
+                               List<String> arguments,
+                               [ProcessOptions options]) {
     var msg = 'Process.start($executable, $arguments, $options)';
     throw new UnsupportedOperationException(msg);
   }
diff --git a/lib/compiler/implementation/lib/isolate_patch.dart b/lib/compiler/implementation/lib/isolate_patch.dart
index e6fc239..5bec001 100644
--- a/lib/compiler/implementation/lib/isolate_patch.dart
+++ b/lib/compiler/implementation/lib/isolate_patch.dart
@@ -96,8 +96,8 @@
 }
 
 ReceivePort _lazyPort;
-patch ReceivePort get port() {
-  if (_lazyPort === null) {
+patch ReceivePort get port {
+  if (_lazyPort == null) {
     _lazyPort = new ReceivePort();
   }
   return _lazyPort;
@@ -393,7 +393,7 @@
  * are actually available.
  */
 class _WorkerStub implements _ManagerStub native "*Worker" {
-  get id() => JS("Object", "#.id", this);
+  get id => JS("Object", "#.id", this);
   void set id(i) { JS("void", "#.id = #", this, i); }
   void set onmessage(f) { JS("void", "#.onmessage = #", this, f); }
   void postMessage(msg) => JS("Object", "#.postMessage(#)", this, msg);
@@ -573,7 +573,7 @@
     _fillStatics(_globalState.currentContext);
     _lazyPort = new ReceivePort();
     replyTo.send(_SPAWNED_SIGNAL, port.toSendPort());
-    
+
     if (_window != null)  {
       _globalState.currentContext.eval(
           () => _setTimerFactoryClosure(_timerFactory));
@@ -625,7 +625,7 @@
   const _BaseSendPort(this._isolateId);
 
   void _checkReplyTo(SendPort replyTo) {
-    if (replyTo !== null
+    if (replyTo != null
         && replyTo is! _NativeJsSendPort
         && replyTo is! _WorkerSendPort
         && replyTo is! _BufferingSendPort) {
@@ -842,7 +842,7 @@
 
   visitList(List list) {
     final seen = _visited[list];
-    if (seen !== null) return;
+    if (seen != null) return;
     _visited[list] = true;
     // TODO(sigmund): replace with the following: (bug #1660)
     // list.forEach(_dispatch);
@@ -851,7 +851,7 @@
 
   visitMap(Map map) {
     final seen = _visited[map];
-    if (seen !== null) return;
+    if (seen != null) return;
 
     _visited[map] = true;
     // TODO(sigmund): replace with the following: (bug #1660)
@@ -1090,7 +1090,7 @@
   }
 
   static bool isPrimitive(x) {
-    return (x === null) || (x is String) || (x is num) || (x is bool);
+    return (x == null) || (x is String) || (x is num) || (x is bool);
   }
 }
 
@@ -1102,7 +1102,7 @@
 
   List visitList(List list) {
     List copy = _visited[list];
-    if (copy !== null) return copy;
+    if (copy != null) return copy;
 
     int len = list.length;
 
@@ -1117,7 +1117,7 @@
 
   Map visitMap(Map map) {
     Map copy = _visited[map];
-    if (copy !== null) return copy;
+    if (copy != null) return copy;
 
     // TODO(floitsch): we loose the generic type of the map.
     copy = new Map();
@@ -1138,7 +1138,7 @@
 
   visitList(List list) {
     int copyId = _visited[list];
-    if (copyId !== null) return ['ref', copyId];
+    if (copyId != null) return ['ref', copyId];
 
     int id = _nextFreeRefId++;
     _visited[list] = id;
@@ -1149,7 +1149,7 @@
 
   visitMap(Map map) {
     int copyId = _visited[map];
-    if (copyId !== null) return ['ref', copyId];
+    if (copyId != null) return ['ref', copyId];
 
     int id = _nextFreeRefId++;
     _visited[map] = id;
@@ -1176,7 +1176,7 @@
   _Deserializer();
 
   static bool isPrimitive(x) {
-    return (x === null) || (x is String) || (x is num) || (x is bool);
+    return (x == null) || (x is String) || (x is num) || (x is bool);
   }
 
   deserialize(x) {
@@ -1201,7 +1201,7 @@
   _deserializeRef(List x) {
     int id = x[1];
     var result = _deserialized[id];
-    assert(result !== null);
+    assert(result != null);
     return result;
   }
 
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index 2515116..d2e5810 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -46,19 +46,19 @@
 
 gtB(var a, var b) => (a is num && b is num)
     ? JS('bool', r'# > #', a, b)
-    : gt$slow(a, b) === true;
+    : identical(gt$slow(a, b), true);
 
 geB(var a, var b) => (a is num && b is num)
     ? JS('bool', r'# >= #', a, b)
-    : ge$slow(a, b) === true;
+    : identical(ge$slow(a, b), true);
 
 ltB(var a, var b) => (a is num && b is num)
     ? JS('bool', r'# < #', a, b)
-    : lt$slow(a, b) === true;
+    : identical(lt$slow(a, b), true);
 
 leB(var a, var b) => (a is num && b is num)
     ? JS('bool', r'# <= #', a, b)
-    : le$slow(a, b) === true;
+    : identical(le$slow(a, b), true);
 
 index(var a, var index) {
   // The type test may cause a NullPointerException to be thrown but
@@ -69,7 +69,7 @@
       a, a);
   if (isJsArrayOrString) {
     var key = JS('int', '# >>> 0', index);
-    if (key === index && key < JS('int', r'#.length', a)) {
+    if (identical(key, index) && key < JS('int', r'#.length', a)) {
       return JS('var', r'#[#]', a, key);
     }
   }
@@ -85,7 +85,7 @@
       a, a);
   if (isMutableJsArray) {
     var key = JS('int', '# >>> 0', index);
-    if (key === index && key < JS('int', r'#.length', a)) {
+    if (identical(key, index) && key < JS('int', r'#.length', a)) {
       JS('void', r'#[#] = #', a, key, value);
       return;
     }
@@ -112,7 +112,7 @@
 }
 
 bool isJsArray(var value) {
-  return value !== null && JS('bool', r'#.constructor === Array', value);
+  return value != null && JS('bool', r'#.constructor === Array', value);
 }
 
 add$slow(var a, var b) {
@@ -182,7 +182,7 @@
   if (JS('bool', r'# == null', b)) return false;
   if (JS('bool', r'typeof # === "object"', a)) {
     if (JS_HAS_EQUALS(a)) {
-      return UNINTERCEPTED(a == b) === true;
+      return identical(UNINTERCEPTED(a == b), true);
     }
   }
   // TODO(lrn): is NaN === NaN ? Is -0.0 === 0.0 ?
@@ -296,7 +296,7 @@
   if (a is String || isJsArray(a)) {
     if (index is !int) {
       if (index is !num) throw new ArgumentError(index);
-      if (index.truncate() !== index) throw new ArgumentError(index);
+      if (!identical(index.truncate(), index)) throw new ArgumentError(index);
     }
     if (index < 0 || index >= a.length) {
       throw new IndexOutOfRangeException(index);
@@ -357,7 +357,7 @@
 
   static int objectHashCode(object) {
     int hash = JS('var', r'#.$identityHash', object);
-    if (hash === null) {
+    if (hash == null) {
       // TOOD(ahe): We should probably randomize this somehow.
       hash = ++hashCodeSeed;
       JS('void', r'#.$identityHash = #', object, hash);
@@ -403,11 +403,11 @@
     var match = JS('List',
                    r'/^\s*[+-]?(?:0(x)[a-f0-9]+|\d+)\s*$/i.exec(#)',
                    string);
-    if (match === null) {
+    if (match == null) {
       throw new FormatException(string);
     }
     var base = 10;
-    if (match[1] !== null) base = 16;
+    if (match[1] != null) base = 16;
     var result = JS('num', r'parseInt(#, #)', string, base);
     if (result.isNaN()) throw new FormatException(string);
     return result;
@@ -448,7 +448,7 @@
     }
     // TODO(kasperl): If the namer gave us a fresh global name, we may
     // want to remove the numeric suffix that makes it unique too.
-    if (name.charCodeAt(0) === DOLLAR_CHAR_VALUE) name = name.substring(1);
+    if (identical(name.charCodeAt(0), DOLLAR_CHAR_VALUE)) name = name.substring(1);
     return name;
   }
 
@@ -458,7 +458,7 @@
   }
 
   static List newList(length) {
-    if (length === null) return JS('Object', r'new Array()');
+    if (length == null) return JS('Object', r'new Array()');
     if ((length is !int) || (length < 0)) {
       throw new ArgumentError(length);
     }
@@ -539,50 +539,50 @@
 
   static getYear(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCFullYear()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getFullYear()', lazyAsJsDate(receiver));
+      ? JS('int', r'(#.getUTCFullYear() + 0)', lazyAsJsDate(receiver))
+      : JS('int', r'(#.getFullYear() + 0)', lazyAsJsDate(receiver));
   }
 
   static getMonth(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCMonth()', lazyAsJsDate(receiver)) + 1
-      : JS('int', r'#.getMonth()', lazyAsJsDate(receiver)) + 1;
+      ? JS('int', r'#.getUTCMonth() + 1', lazyAsJsDate(receiver))
+      : JS('int', r'#.getMonth() + 1', lazyAsJsDate(receiver));
   }
 
   static getDay(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCDate()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getDate()', lazyAsJsDate(receiver));
+      ? JS('int', r'(#.getUTCDate() + 0)', lazyAsJsDate(receiver))
+      : JS('int', r'(#.getDate() + 0)', lazyAsJsDate(receiver));
   }
 
   static getHours(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCHours()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getHours()', lazyAsJsDate(receiver));
+      ? JS('int', r'(#.getUTCHours() + 0)', lazyAsJsDate(receiver))
+      : JS('int', r'(#.getHours() + 0)', lazyAsJsDate(receiver));
   }
 
   static getMinutes(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCMinutes()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getMinutes()', lazyAsJsDate(receiver));
+      ? JS('int', r'(#.getUTCMinutes() + 0)', lazyAsJsDate(receiver))
+      : JS('int', r'(#.getMinutes() + 0)', lazyAsJsDate(receiver));
   }
 
   static getSeconds(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCSeconds()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getSeconds()', lazyAsJsDate(receiver));
+      ? JS('int', r'(#.getUTCSeconds() + 0)', lazyAsJsDate(receiver))
+      : JS('int', r'(#.getSeconds() + 0)', lazyAsJsDate(receiver));
   }
 
   static getMilliseconds(receiver) {
     return (receiver.isUtc)
-      ? JS('int', r'#.getUTCMilliseconds()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getMilliseconds()', lazyAsJsDate(receiver));
+      ? JS('int', r'(#.getUTCMilliseconds() + 0)', lazyAsJsDate(receiver))
+      : JS('int', r'(#.getMilliseconds() + 0)', lazyAsJsDate(receiver));
   }
 
   static getWeekday(receiver) {
     int weekday = (receiver.isUtc)
-      ? JS('int', r'#.getUTCDay()', lazyAsJsDate(receiver))
-      : JS('int', r'#.getDay()', lazyAsJsDate(receiver));
+      ? JS('int', r'#.getUTCDay() + 0', lazyAsJsDate(receiver))
+      : JS('int', r'#.getDay() + 0', lazyAsJsDate(receiver));
     // Adjust by one because JS weeks start on Sunday.
     return (weekday + 6) % 7 + 1;
   }
@@ -671,7 +671,7 @@
 }
 
 listInsertRange(receiver, start, length, initialValue) {
-  if (length === 0) {
+  if (length == 0) {
     return;
   }
   checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
@@ -690,7 +690,7 @@
               receiver,
               start + length,
               receiverLength - start);
-  if (initialValue !== null) {
+  if (initialValue != null) {
     for (int i = start; i < start + length; i++) {
       receiver[i] = initialValue;
     }
@@ -703,7 +703,7 @@
 
 
 checkNull(object) {
-  if (object === null) throw new NullPointerException();
+  if (object == null) throw new NullPointerException();
   return object;
 }
 
@@ -821,7 +821,7 @@
  * object out of the wrapper again.
  */
 $throw(ex) {
-  if (ex === null) ex = const NullPointerException();
+  if (ex == null) ex = const NullPointerException();
   var jsError = JS('Object', r'new Error()');
   JS('void', r'#.name = #', jsError, ex);
   JS('void', r'#.description = #', jsError, ex);
@@ -1001,7 +1001,7 @@
  * closure when the Dart closure is passed to the DOM.
  */
 convertDartClosureToJS(closure, int arity) {
-  if (closure === null) return null;
+  if (closure == null) return null;
   var function = JS('var', r'#.$identity', closure);
   if (JS('bool', r'!!#', function)) return function;
 
@@ -1058,11 +1058,11 @@
 
 setRuntimeTypeInfo(target, typeInfo) {
   // We have to check for null because factories may return null.
-  if (target !== null) JS('var', r'#.builtin$typeInfo = #', target, typeInfo);
+  if (target != null) JS('var', r'#.builtin$typeInfo = #', target, typeInfo);
 }
 
 getRuntimeTypeInfo(target) {
-  if (target === null) return null;
+  if (target == null) return null;
   var res = JS('var', r'#.builtin$typeInfo', target);
   // If the object does not have runtime type information, return an
   // empty literal, to avoid null checks.
@@ -1078,79 +1078,79 @@
  */
 boolConversionCheck(value) {
   boolTypeCheck(value);
-  assert(value !== null);
+  assert(value != null);
   return value;
 }
 
 stringTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is String) return value;
   throw new TypeErrorImplementation(value, 'String');
 }
 
 stringTypeCast(value) {
-  if (value is String || value === null) return value;
+  if (value is String || value == null) return value;
   // TODO(lrn): When reified types are available, pass value.class and String.
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'String');
 }
 
 doubleTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is double) return value;
   throw new TypeErrorImplementation(value, 'double');
 }
 
 doubleTypeCast(value) {
-  if (value is double || value === null) return value;
+  if (value is double || value == null) return value;
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'double');
 }
 
 numTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is num) return value;
   throw new TypeErrorImplementation(value, 'num');
 }
 
 numTypeCast(value) {
-  if (value is num || value === null) return value;
+  if (value is num || value == null) return value;
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'num');
 }
 
 boolTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is bool) return value;
   throw new TypeErrorImplementation(value, 'bool');
 }
 
 boolTypeCast(value) {
-  if (value is bool || value === null) return value;
+  if (value is bool || value == null) return value;
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'bool');
 }
 
 functionTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is Function) return value;
   throw new TypeErrorImplementation(value, 'Function');
 }
 
 functionTypeCast(value) {
-  if (value is Function || value === null) return value;
+  if (value is Function || value == null) return value;
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'Function');
 }
 
 intTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is int) return value;
   throw new TypeErrorImplementation(value, 'int');
 }
 
 intTypeCast(value) {
-  if (value is int || value === null) return value;
+  if (value is int || value == null) return value;
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'int');
 }
@@ -1174,7 +1174,7 @@
  * that type.
  */
 propertyTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (JS('bool', '!!#[#]', value, property)) return value;
   propertyTypeError(value, property);
 }
@@ -1185,7 +1185,7 @@
  * that type.
  */
 propertyTypeCast(value, property) {
-  if (value === null || JS('bool', '!!#[#]', value, property)) return value;
+  if (value == null || JS('bool', '!!#[#]', value, property)) return value;
   propertyTypeCastError(value, property);
 }
 
@@ -1195,8 +1195,8 @@
  * time.
  */
 callTypeCheck(value, property) {
-  if (value === null) return value;
-  if ((JS('String', 'typeof #', value) === 'object')
+  if (value == null) return value;
+  if ((identical(JS('String', 'typeof #', value), 'object'))
       && JS('bool', '#[#]()', value, property)) {
     return value;
   }
@@ -1209,7 +1209,7 @@
  * time.
  */
 callTypeCast(value, property) {
-  if (value === null
+  if (value == null
       || ((JS('bool', 'typeof # === "object"', value))
           && JS('bool', '#[#]()', value, property))) {
     return value;
@@ -1222,7 +1222,7 @@
  * supertype since [value] can be a JS primitive.
  */
 numberOrStringSuperTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is String) return value;
   if (value is num) return value;
   if (JS('bool', '!!#[#]', value, property)) return value;
@@ -1236,7 +1236,7 @@
 }
 
 numberOrStringSuperNativeTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is String) return value;
   if (value is num) return value;
   if (JS('bool', '#[#]()', value, property)) return value;
@@ -1244,7 +1244,7 @@
 }
 
 numberOrStringSuperNativeTypeCast(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is String) return value;
   if (value is num) return value;
   if (JS('bool', '#[#]()', value, property)) return value;
@@ -1256,7 +1256,7 @@
  * since [value] can be a JS primitive.
  */
 stringSuperTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is String) return value;
   if (JS('bool', '!!#[#]', value, property)) return value;
   propertyTypeError(value, property);
@@ -1268,14 +1268,14 @@
 }
 
 stringSuperNativeTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is String) return value;
   if (JS('bool', '#[#]()', value, property)) return value;
   propertyTypeError(value, property);
 }
 
 stringSuperNativeTypeCast(value, property) {
-  if (value is String || value === null) return value;
+  if (value is String || value == null) return value;
   if (JS('bool', '#[#]()', value, property)) return value;
   propertyTypeCastError(value, property);
 }
@@ -1285,19 +1285,19 @@
  * since [value] can be a JS array.
  */
 listTypeCheck(value) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is List) return value;
   throw new TypeErrorImplementation(value, 'List');
 }
 
 listTypeCast(value) {
-  if (value is List || value === null) return value;
+  if (value is List || value == null) return value;
   throw new CastErrorImplementation(
       Primitives.objectTypeName(value), 'List');
 }
 
 listSuperTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is List) return value;
   if (JS('bool', '!!#[#]', value, property)) return value;
   propertyTypeError(value, property);
@@ -1309,14 +1309,14 @@
 }
 
 listSuperNativeTypeCheck(value, property) {
-  if (value === null) return value;
+  if (value == null) return value;
   if (value is List) return value;
   if (JS('bool', '#[#]()', value, property)) return value;
   propertyTypeError(value, property);
 }
 
 listSuperNativeTypeCast(value, property) {
-  if (value is List || value === null) return value;
+  if (value is List || value == null) return value;
   if (JS('bool', '#[#]()', value, property)) return value;
   propertyTypeCastError(value, property);
 }
@@ -1372,7 +1372,7 @@
   }
   // Compare to true to avoid boolean conversion check in checked
   // mode.
-  if (condition !== true) throw new AssertionError();
+  if (!identical(condition, true)) throw new AssertionError();
 }
 
 /**
diff --git a/lib/compiler/implementation/lib/native_helper.dart b/lib/compiler/implementation/lib/native_helper.dart
index 909672e..1ff2e1c 100644
--- a/lib/compiler/implementation/lib/native_helper.dart
+++ b/lib/compiler/implementation/lib/native_helper.dart
@@ -62,9 +62,9 @@
 }
 
 String constructorNameFallback(object) {
-  if (object === null) return 'Null';
+  if (object == null) return 'Null';
   var constructor = JS('var', "#.constructor", object);
-  if (JS('String', "typeof(#)", constructor) === 'function') {
+  if (identical(JS('String', "typeof(#)", constructor), 'function')) {
     // The constructor isn't null or undefined at this point. Try
     // to grab hold of its name.
     var name = JS('var', '#.name', constructor);
@@ -74,9 +74,9 @@
     // we have to fall through to the toString() based implementation
     // below in that case.
     if (name is String
-        && name !== ''
-        && name !== 'Object'
-        && name !== 'Function.prototype') {  // Can happen in Opera.
+        && !identical(name, '')
+        && !identical(name, 'Object')
+        && !identical(name, 'Function.prototype')) {  // Can happen in Opera.
       return name;
     }
   }
@@ -119,7 +119,7 @@
  */
 Function getFunctionForTypeNameOf() {
   // If we're not in the browser, we're almost certainly running on v8.
-  if (JS('String', 'typeof(navigator)') !== 'object') return typeNameInChrome;
+  if (!identical(JS('String', 'typeof(navigator)'), 'object')) return typeNameInChrome;
 
   String userAgent = JS('String', "navigator.userAgent");
   if (contains(userAgent, 'Chrome') || contains(userAgent, 'DumpRenderTree')) {
@@ -152,7 +152,7 @@
  * Returns the type name of [obj].
  */
 String getTypeNameOf(var obj) {
-  if (_getTypeNameOf === null) _getTypeNameOf = getFunctionForTypeNameOf();
+  if (_getTypeNameOf == null) _getTypeNameOf = getFunctionForTypeNameOf();
   return _getTypeNameOf(obj);
 }
 
@@ -192,22 +192,22 @@
   String tag = getTypeNameOf(obj);
   var method = JS('var', '#[#]', methods, tag);
 
-  if (method === null && _dynamicMetadata !== null) {
+  if (method == null && _dynamicMetadata != null) {
     for (int i = 0; i < arrayLength(_dynamicMetadata); i++) {
       MetaInfo entry = arrayGet(_dynamicMetadata, i);
       if (JS('bool', '#', propertyGet(entry._set, tag))) {
         method = propertyGet(methods, entry._tag);
-        if (method !== null) break;
+        if (method != null) break;
       }
     }
   }
 
-  if (method === null) {
+  if (method == null) {
     method = propertyGet(methods, 'Object');
   }
 
   var proto = JS('var', 'Object.getPrototypeOf(#)', obj);
-  if (method === null) {
+  if (method == null) {
     // If the method cannot be found, we use a trampoline method that
     // will throw a [NoSuchMethodError] if the object is of the
     // exact prototype, or will call [dynamicBind] again if the object
@@ -248,7 +248,7 @@
  */
 dynamicFunction(name) {
   var f = JS('var', 'Object.prototype[#]', name);
-  if (f !== null && JS('bool', '!!#.methods', f)) {
+  if (f != null && JS('bool', '!!#.methods', f)) {
     return JS('var', '#.methods', f);
   }
 
@@ -258,7 +258,7 @@
   // If there is a method attached to the Dart Object class, use it as
   // the method to call in case no method is registered for that type.
   var dartMethod = JS('var', 'Object.getPrototypeOf(#)[#]', const Object(), name);
-  if (dartMethod !== null) propertySet(methods, 'Object', dartMethod);
+  if (dartMethod != null) propertySet(methods, 'Object', dartMethod);
 
   var bind = JS('var',
       'function() {'
@@ -300,7 +300,7 @@
   // that access native classes (eg multiple DOM isolates),
   // [_dynamicMetadata] cannot be a field, otherwise all non-main
   // isolates would not have any value for it.
-  if (JS('var', 'typeof(\$dynamicMetadata)') === 'undefined') {
+  if (identical(JS('var', 'typeof(\$dynamicMetadata)'), 'undefined')) {
     _dynamicMetadata = <MetaInfo>[];
   }
   return JS('var', '\$dynamicMetadata');
diff --git a/lib/compiler/implementation/lib/regexp_helper.dart b/lib/compiler/implementation/lib/regexp_helper.dart
index 0dc67b6..42f6493 100644
--- a/lib/compiler/implementation/lib/regexp_helper.dart
+++ b/lib/compiler/implementation/lib/regexp_helper.dart
@@ -16,7 +16,7 @@
 
 regExpGetNative(JSSyntaxRegExp regExp) {
   var r = JS('var', r'#._re', regExp);
-  if (r === null) {
+  if (r == null) {
     r = JS('var', r'#._re = #', regExp, regExpMakeNative(regExp));
   }
   return r;
@@ -26,7 +26,7 @@
   JS('var', r'#._re = #', regExp, regExpMakeNative(regExp, global: true));
 }
 
-regExpMakeNative(JSSyntaxRegExp regExp, [bool global = false]) {
+regExpMakeNative(JSSyntaxRegExp regExp, {bool global: false}) {
   String pattern = regExp.pattern;
   bool multiLine = regExp.multiLine;
   bool ignoreCase = regExp.ignoreCase;
diff --git a/lib/compiler/implementation/lib/string_helper.dart b/lib/compiler/implementation/lib/string_helper.dart
index a67e784..a4b4ef4 100644
--- a/lib/compiler/implementation/lib/string_helper.dart
+++ b/lib/compiler/implementation/lib/string_helper.dart
@@ -59,7 +59,7 @@
 
 stringContainsUnchecked(receiver, other, startIndex) {
   if (other is String) {
-    return receiver.indexOf(other, startIndex) !== -1;
+    return receiver.indexOf(other, startIndex) != -1;
   } else if (other is JSSyntaxRegExp) {
     return other.hasMatch(receiver.substring(startIndex));
   } else {
diff --git a/lib/compiler/implementation/library_loader.dart b/lib/compiler/implementation/library_loader.dart
index a7ca9e0..7d6bef4 100644
--- a/lib/compiler/implementation/library_loader.dart
+++ b/lib/compiler/implementation/library_loader.dart
@@ -181,7 +181,7 @@
         libraryDependencies.addLast(tag);
       } else if (tag.isLibraryName) {
         tagState = checkTag(TagState.LIBRARY, tag);
-        if (library.libraryTag !== null) {
+        if (library.libraryTag != null) {
           compiler.cancel("duplicated library declaration", node: tag);
         } else {
           library.libraryTag = tag;
@@ -218,7 +218,7 @@
       String name = library.getLibraryOrScriptName();
       LibraryElement existing =
           libraryNames.putIfAbsent(name, () => library);
-      if (existing !== library) {
+      if (!identical(existing, library)) {
         Uri uri = library.entryCompilationUnit.script.uri;
         compiler.reportMessage(
             compiler.spanFromNode(tag.name, uri),
@@ -239,7 +239,7 @@
    * Lazily loads and returns the [LibraryElement] for the dart:core library.
    */
   LibraryElement loadCoreLibrary(LibraryDependencyHandler handler) {
-    if (compiler.coreLibrary === null) {
+    if (compiler.coreLibrary == null) {
       Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core');
       compiler.coreLibrary = createLibrary(handler, coreUri, null, coreUri);
     }
@@ -250,7 +250,7 @@
                         LibraryElement library, String dartLibraryPath) {
     if (library.isPatched) return;
     Uri patchUri = compiler.resolvePatchUri(dartLibraryPath);
-    if (patchUri !== null) {
+    if (patchUri != null) {
       compiler.patchParser.patchLibrary(handler, patchUri, library);
     }
   }
@@ -283,7 +283,7 @@
 
     if (!loadedLibrary.hasLibraryName()) {
       compiler.withCurrentElement(library, () {
-        compiler.reportError(tag === null ? null : tag.uri,
+        compiler.reportError(tag == null ? null : tag.uri,
             'no library name found in ${loadedLibrary.uri}');
       });
     }
@@ -305,7 +305,7 @@
       return element;
     }
     LibraryElement library;
-    if (canonicalUri === null) {
+    if (canonicalUri == null) {
       library = createLibrary();
     } else {
       library = compiler.libraries.putIfAbsent(canonicalUri.toString(),
@@ -370,15 +370,15 @@
                      importedLibrary.exportsHandled,
                      message: 'Exports not handled on $importedLibrary'));
     var combinatorFilter = new CombinatorFilter.fromTag(import);
-    if (import !== null && import.prefix !== null) {
+    if (import != null && import.prefix != null) {
       SourceString prefix = import.prefix.source;
       Element e = importingLibrary.find(prefix);
-      if (e === null) {
+      if (e == null) {
         e = new PrefixElement(prefix, importingLibrary.entryCompilationUnit,
                               import.getBeginToken());
         importingLibrary.addToScope(e, compiler);
       }
-      if (e.kind !== ElementKind.PREFIX) {
+      if (!identical(e.kind, ElementKind.PREFIX)) {
         compiler.withCurrentElement(e, () {
           compiler.reportWarning(new Identifier(e.position()),
           'duplicated definition');
@@ -391,7 +391,7 @@
         // TODO(johnniwinther): Clean-up like [checkDuplicateLibraryName].
         Element existing =
             prefixElement.imported.putIfAbsent(element.name, () => element);
-        if (existing !== element) {
+        if (!identical(existing, element)) {
           compiler.withCurrentElement(existing, () {
             compiler.reportWarning(new Identifier(existing.position()),
             'duplicated import');
@@ -539,7 +539,7 @@
   Element addElementToExportScope(Compiler compiler, Element element) {
     SourceString name = element.name;
     Element existingElement = exportScope[name];
-    if (existingElement !== null) {
+    if (existingElement != null) {
       if (existingElement.getLibrary() != library) {
         // Declared elements hide exported elements.
         element = exportScope[name] = new ErroneousElement(
@@ -572,7 +572,7 @@
    * to filter the element.
    */
   bool addElementToPendingExports(Element element) {
-    if (exportScope[element.name] !== element) {
+    if (!identical(exportScope[element.name], element)) {
       if (!pendingExportSet.contains(element)) {
         pendingExportSet.add(element);
         return true;
diff --git a/lib/compiler/implementation/native_handler.dart b/lib/compiler/implementation/native_handler.dart
index a97651a..0ba42ae 100644
--- a/lib/compiler/implementation/native_handler.dart
+++ b/lib/compiler/implementation/native_handler.dart
@@ -2,15 +2,16 @@
 // 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');
-#import('dart:uri');
-#import('leg.dart');
-#import('elements/elements.dart');
-#import('js_backend/js_backend.dart');
-#import('scanner/scannerlib.dart');
-#import('ssa/ssa.dart');
-#import('tree/tree.dart');
-#import('util/util.dart');
+library native;
+
+import 'dart:uri';
+import 'dart2jslib.dart' hide SourceString;
+import 'elements/elements.dart';
+import 'js_backend/js_backend.dart';
+import 'scanner/scannerlib.dart';
+import 'ssa/ssa.dart';
+import 'tree/tree.dart';
+import 'util/util.dart';
 
 void processNativeClasses(Enqueuer world,
                           CodeEmitterTask emitter,
@@ -96,10 +97,10 @@
 Token handleNativeBlockToSkip(Listener listener, Token token) {
   checkAllowedLibrary(listener, token);
   token = token.next;
-  if (token.kind === STRING_TOKEN) {
+  if (identical(token.kind, STRING_TOKEN)) {
     token = token.next;
   }
-  if (token.stringValue === '{') {
+  if (identical(token.stringValue, '{')) {
     BeginGroupToken beginGroupToken = token;
     token = beginGroupToken.endGroup;
   }
@@ -110,11 +111,11 @@
   checkAllowedLibrary(listener, token);
   listener.handleIdentifier(token);
   token = token.next;
-  if (token.kind !== STRING_TOKEN) {
+  if (!identical(token.kind, STRING_TOKEN)) {
     return listener.unexpected(token);
   }
   token = token.next;
-  if (token.stringValue !== '{') {
+  if (!identical(token.stringValue, '{')) {
     return listener.unexpected(token);
   }
   BeginGroupToken beginGroupToken = token;
@@ -125,7 +126,7 @@
 Token handleNativeClassBody(Listener listener, Token token) {
   checkAllowedLibrary(listener, token);
   token = token.next;
-  if (token.kind !== STRING_TOKEN) {
+  if (!identical(token.kind, STRING_TOKEN)) {
     listener.unexpected(token);
   } else {
     token = token.next;
@@ -139,7 +140,7 @@
   listener.beginReturnStatement(token);
   token = token.next;
   bool hasExpression = false;
-  if (token.kind === STRING_TOKEN) {
+  if (identical(token.kind, STRING_TOKEN)) {
     hasExpression = true;
     listener.beginLiteralString(token);
     listener.endLiteralString(0);
@@ -214,7 +215,7 @@
   bool hasBody = false;
   bool isRedirecting = false;
   String nativeMethodName = element.name.slowToString();
-  if (nativeBody !== null) {
+  if (nativeBody != null) {
     LiteralString jsCode = nativeBody.asLiteralString();
     String str = jsCode.dartString.slowToString();
     if (nativeRedirectionRegExp.hasMatch(str)) {
diff --git a/lib/compiler/implementation/patch_parser.dart b/lib/compiler/implementation/patch_parser.dart
index a8028ad..9d1b7d3 100644
--- a/lib/compiler/implementation/patch_parser.dart
+++ b/lib/compiler/implementation/patch_parser.dart
@@ -111,15 +111,16 @@
  * - Work on function parameters is performed on the declaration of the function
  *   element.
  */
-#library("patchparser");
 
-#import("dart:uri");
-#import("tree/tree.dart", prefix: "tree");
-#import("leg.dart", prefix: 'leg');  // CompilerTask, Compiler.
-#import("apiimpl.dart");
-#import("scanner/scannerlib.dart");  // Scanner, Parsers, Listeners
-#import("elements/elements.dart");
-#import('util/util.dart');
+library patchparser;
+
+import "dart:uri";
+import "tree/tree.dart" as tree;
+import "dart2jslib.dart" as leg;  // CompilerTask, Compiler.
+import "apiimpl.dart";
+import "scanner/scannerlib.dart";  // Scanner, Parsers, Listeners
+import "elements/elements.dart";
+import 'util/util.dart';
 
 class PatchParserTask extends leg.CompilerTask {
   PatchParserTask(leg.Compiler compiler): super(compiler);
@@ -178,7 +179,7 @@
       PatchMemberListener listener = new PatchMemberListener(compiler, element);
       Parser parser = new PatchClassElementParser(listener);
       Token token = parser.parseTopLevelDeclaration(element.beginToken);
-      assert(token === element.endToken.next);
+      assert(identical(token, element.endToken.next));
       element.cachedNode = listener.popNode();
       assert(listener.nodes.isEmpty());
 
@@ -192,8 +193,8 @@
     while (!patches.isEmpty()) {
       Element patchElement = patches.head;
       Element originalElement = original.localLookup(patchElement.name);
-      if (patchElement.isAccessor() && originalElement !== null) {
-        if (originalElement.kind !== ElementKind.ABSTRACT_FIELD) {
+      if (patchElement.isAccessor() && originalElement != null) {
+        if (!identical(originalElement.kind, ElementKind.ABSTRACT_FIELD)) {
           compiler.internalError(
               "Cannot patch non-getter/setter with getter/setter",
               element: originalElement);
@@ -205,7 +206,7 @@
           originalElement = originalField.setter;
         }
       }
-      if (originalElement === null) {
+      if (originalElement == null) {
         if (isPatchElement(patchElement)) {
           compiler.internalError("Cannot patch non-existing member '"
                         "${patchElement.name.slowToString()}'.");
@@ -263,7 +264,7 @@
       compiler.internalError("Trying to patch a function more than once.",
                     element: element);
     }
-    if (element.cachedNode !== null) {
+    if (element.cachedNode != null) {
       compiler.internalError("Trying to patch an already compiled function.",
                     element: element);
     }
@@ -293,7 +294,7 @@
   PatchListener get patchListener => listener;
 
   bool isPatch(Token token) {
-    return token.stringValue === null &&
+    return token.stringValue == null &&
            token.slowToString() == "patch";
   }
 
@@ -308,10 +309,10 @@
     Token patch = token;
     token = token.next;
     String value = token.stringValue;
-    if (value === 'interface'
-        || value === 'typedef'
-        || value === '#'
-        || value === 'abstract') {
+    if (identical(value, 'interface')
+        || identical(value, 'typedef')
+        || identical(value, '#')
+        || identical(value, 'abstract')) {
       // At the top level, you can only patch functions and classes.
       // Patch classes and functions can't be marked abstract.
       return listener.unexpected(patch);
@@ -372,7 +373,7 @@
   }
 
   void beginPatch(Token token) {
-    if (token.next.stringValue === "class") {
+    if (identical(token.next.stringValue, "class")) {
       isClassPatch = true;
     } else {
       isMemberPatch = true;
@@ -381,7 +382,7 @@
   }
 
   void endPatch(Token token) {
-    if (token.next.stringValue === "class") {
+    if (identical(token.next.stringValue, "class")) {
       isClassPatch = false;
     } else {
       isMemberPatch = false;
@@ -411,41 +412,44 @@
           listener.internalErrorOnElement(element,
                                           "Member patch is not a function.");
         }
-        if (existing.kind === ElementKind.ABSTRACT_FIELD) {
+        FunctionElement functionElement = element;
+        if (identical(existing.kind, ElementKind.ABSTRACT_FIELD)) {
           if (!element.isAccessor()) {
             listener.internalErrorOnElement(
-                element, "Patching non-accessor with accessor");
+                functionElement, "Patching non-accessor with accessor");
           }
           AbstractFieldElement field = existing;
-          if (element.isGetter()) {
+          if (functionElement.isGetter()) {
             existing = field.getter;
           } else {
             existing = field.setter;
           }
         }
         if (existing is! FunctionElement) {
-          listener.internalErrorOnElement(element,
+          listener.internalErrorOnElement(functionElement,
                                           "No corresponding method for patch.");
         }
-        FunctionElement function = existing;
-        if (function.isPatched) {
+        FunctionElement existingFunction = existing;
+        if (existingFunction.isPatched) {
           listener.internalErrorOnElement(
-              element, "Patching the same function more than once.");
+              functionElement, "Patching the same function more than once.");
         }
-        function.patch = element;
-        element.origin = function;
+        existingFunction.patch = functionElement;
+        functionElement.origin = existingFunction;
       } else {
+        assert(leg.invariant(element, element is ClassElement));
+        ClassElement classElement = element;
         if (existing is! ClassElement) {
           listener.internalErrorOnElement(
-              element, "Patching a non-class with a class patch.");
+              classElement, "Patching a non-class with a class patch.");
         }
-        ClassElement classElement = existing;
-        if (classElement.isPatched) {
+        ClassElement existingClass = existing;
+        if (existingClass.isPatched) {
           listener.internalErrorOnElement(
-              element, "Patching the same class more than once.");
+              classElement, "Patching the same class more than once.");
         }
-        classElement.patch = element;
-        element.origin = classElement;
+        existingClass.patch = classElement;
+        classElement.origin = existingClass;
       }
     }
     super.pushElement(element);
@@ -469,7 +473,7 @@
   }
 
   void beginPatch(Token token) {
-    if (token.next.stringValue === "class") {
+    if (identical(token.next.stringValue, "class")) {
       isClassPatch = true;
     } else {
       isMemberPatch = true;
@@ -478,7 +482,7 @@
   }
 
   void endPatch(Token token) {
-    if (token.next.stringValue === "class") {
+    if (identical(token.next.stringValue, "class")) {
       isClassPatch = false;
     } else {
       isMemberPatch = false;
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolution/members.dart
similarity index 89%
rename from lib/compiler/implementation/resolver.dart
rename to lib/compiler/implementation/resolution/members.dart
index 7409bc6..d62146da 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolution/members.dart
@@ -5,7 +5,7 @@
 abstract class TreeElements {
   Element operator[](Node node);
   Selector getSelector(Send send);
-  DartType getType(TypeAnnotation annotation);
+  DartType getType(Node node);
   bool isParameterChecked(Element element);
 }
 
@@ -13,13 +13,13 @@
   final Element currentElement;
   final Map<Node, Element> map;
   final Map<Node, Selector> selectors;
-  final Map<TypeAnnotation, DartType> types;
+  final Map<Node, DartType> types;
   final Set<Element> checkedParameters;
 
   TreeElementMapping([Element this.currentElement])
       : map = new LinkedHashMap<Node, Element>(),
         selectors = new LinkedHashMap<Node, Selector>(),
-        types = new LinkedHashMap<TypeAnnotation, DartType>(),
+        types = new LinkedHashMap<Node, DartType>(),
         checkedParameters = new Set<Element>();
 
   operator []=(Node node, Element element) {
@@ -43,11 +43,11 @@
   operator [](Node node) => map[node];
   void remove(Node node) { map.remove(node); }
 
-  void setType(TypeAnnotation annotation, DartType type) {
-    types[annotation] = type;
+  void setType(Node node, DartType type) {
+    types[node] = type;
   }
 
-  DartType getType(TypeAnnotation annotation) => types[annotation];
+  DartType getType(Node node) => types[node];
 
   void setSelector(Node node, Selector selector) {
     selectors[node] = selector;
@@ -68,17 +68,17 @@
   TreeElements resolve(Element element) {
     return measure(() {
       ElementKind kind = element.kind;
-      if (kind === ElementKind.GENERATIVE_CONSTRUCTOR ||
-          kind === ElementKind.FUNCTION ||
-          kind === ElementKind.GETTER ||
-          kind === ElementKind.SETTER) {
+      if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR) ||
+          identical(kind, ElementKind.FUNCTION) ||
+          identical(kind, ElementKind.GETTER) ||
+          identical(kind, ElementKind.SETTER)) {
         return resolveMethodElement(element);
       }
 
-      if (kind === ElementKind.FIELD) return resolveField(element);
+      if (identical(kind, ElementKind.FIELD)) return resolveField(element);
 
-      if (kind === ElementKind.PARAMETER ||
-          kind === ElementKind.FIELD_PARAMETER) {
+      if (identical(kind, ElementKind.PARAMETER) ||
+          identical(kind, ElementKind.FIELD_PARAMETER)) {
         return resolveParameter(element);
       }
 
@@ -87,7 +87,7 @@
     });
   }
 
-  bool isNamedConstructor(Send node) => node.receiver !== null;
+  bool isNamedConstructor(Send node) => node.receiver != null;
 
   SourceString getConstructorName(Send node) {
     return node.selector.asIdentifier().source;
@@ -97,7 +97,7 @@
                                    SourceString constructorName) {
     String classNameString = className.slowToString();
     String constructorNameString = constructorName.slowToString();
-    return (constructorName === const SourceString(''))
+    return (identical(constructorName, const SourceString('')))
         ? classNameString
         : "$classNameString.$constructorNameString";
    }
@@ -111,8 +111,8 @@
     FunctionExpression node = constructor.parseNode(compiler);
 
     // A synthetic constructor does not have a node.
-    if (node === null) return null;
-    if (node.initializers === null) return null;
+    if (node == null) return null;
+    if (node.initializers == null) return null;
     Link<Node> initializers = node.initializers.nodes;
     if (!initializers.isEmpty() &&
         Initializers.isConstructorRedirect(initializers.head)) {
@@ -138,7 +138,7 @@
                                      FunctionElement redirection) {
     Set<FunctionElement> seen = new Set<FunctionElement>();
     seen.add(constructor);
-    while (redirection !== null) {
+    while (redirection != null) {
       if (seen.contains(redirection)) {
         resolver.visitor.error(node, MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE);
         return;
@@ -191,7 +191,7 @@
     if (originSignature.returnType != patchSignature.returnType) {
       compiler.withCurrentElement(patch, () {
         Node errorNode =
-            patchTree.returnType !== null ? patchTree.returnType : patchTree;
+            patchTree.returnType != null ? patchTree.returnType : patchTree;
         error(errorNode, MessageKind.PATCH_RETURN_TYPE_MISMATCH, [origin.name,
               originSignature.returnType, patchSignature.returnType]);
       });
@@ -238,10 +238,11 @@
   TreeElements resolveMethodElement(FunctionElement element) {
     assert(invariant(element, element.isDeclaration));
     return compiler.withCurrentElement(element, () {
-      bool isConstructor = element.kind === ElementKind.GENERATIVE_CONSTRUCTOR;
+      bool isConstructor =
+          identical(element.kind, ElementKind.GENERATIVE_CONSTRUCTOR);
       TreeElements elements =
           compiler.enqueuer.resolution.getCachedElements(element);
-      if (elements !== null) {
+      if (elements != null) {
         assert(isConstructor);
         return elements;
       }
@@ -252,7 +253,7 @@
       return compiler.withCurrentElement(element, () {
         FunctionExpression tree = element.parseNode(compiler);
         if (isConstructor) {
-          if (tree.returnType !== null) {
+          if (tree.returnType != null) {
             error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE);
           }
           resolveConstructorImplementation(element, tree);
@@ -267,7 +268,7 @@
           InitializerResolver resolver = new InitializerResolver(visitor);
           FunctionElement redirection =
               resolver.resolveInitializers(element, tree);
-          if (redirection !== null) {
+          if (redirection != null) {
             resolveRedirectingConstructor(resolver, tree, element, redirection);
           }
         } else if (tree.initializers != null) {
@@ -286,11 +287,11 @@
 
   void resolveConstructorImplementation(FunctionElement constructor,
                                         FunctionExpression node) {
-    if (constructor.defaultImplementation !== constructor) return;
+    if (!identical(constructor.defaultImplementation, constructor)) return;
     ClassElement intrface = constructor.getEnclosingClass();
     if (!intrface.isInterface()) return;
     DartType defaultType = intrface.defaultClass;
-    if (defaultType === null) {
+    if (defaultType == null) {
       error(node, MessageKind.NO_DEFAULT_CLASS, [intrface.name]);
     }
     ClassElement defaultClass = defaultType.element;
@@ -333,7 +334,7 @@
       constructor.defaultImplementation =
           defaultClass.lookupFactoryConstructor(selector);
     }
-    if (constructor.defaultImplementation === null) {
+    if (constructor.defaultImplementation == null) {
       // We failed to find a constructor named either
       // "MyInterface.name" or "MyClass.name".
       // TODO(aprelev@gmail.com): Use constructorNameForDiagnostics in
@@ -371,10 +372,10 @@
   }
 
   DartType resolveReturnType(Element element, TypeAnnotation annotation) {
-    if (annotation === null) return compiler.types.dynamicType;
+    if (annotation == null) return compiler.types.dynamicType;
     ResolverVisitor visitor = new ResolverVisitor(compiler, element);
     DartType result = visitor.resolveTypeAnnotation(annotation);
-    if (result === null) {
+    if (result == null) {
       // TODO(karklose): warning.
       return compiler.types.dynamicType;
     }
@@ -394,7 +395,7 @@
         compiler.reportMessage(
           compiler.spanFromNode(from),
           MessageKind.CYCLIC_CLASS_HIERARCHY.error([cls.name]),
-          api.Diagnostic.ERROR);
+          Diagnostic.ERROR);
         cls.supertypeLoadState = STATE_DONE;
         cls.allSupertypes = const Link<DartType>().prepend(
             compiler.objectClass.computeType(compiler));
@@ -476,7 +477,7 @@
         compiler.reportMessage(
           compiler.spanFromElement(member),
           MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER.error(),
-          api.Diagnostic.ERROR);
+          Diagnostic.ERROR);
       }
       if (member.isConstructor()) {
         final mismatchedFlagsBits =
@@ -488,7 +489,7 @@
           compiler.reportMessage(
             compiler.spanFromElement(member),
             MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS.error([mismatchedFlags]),
-            api.Diagnostic.ERROR);
+            Diagnostic.ERROR);
         }
       }
       checkAbstractField(member);
@@ -505,30 +506,30 @@
     // Find the associated abstract field.
     ClassElement classElement = member.getEnclosingClass();
     Element lookupElement = classElement.lookupLocalMember(member.name);
-    if (lookupElement === null) {
+    if (lookupElement == null) {
       compiler.internalErrorOnElement(member,
                                       "No abstract field for accessor");
-    } else if (lookupElement.kind !== ElementKind.ABSTRACT_FIELD) {
+    } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) {
        compiler.internalErrorOnElement(
            member, "Inaccessible abstract field for accessor");
     }
     AbstractFieldElement field = lookupElement;
 
-    if (field.getter === null) return;
-    if (field.setter === null) return;
+    if (field.getter == null) return;
+    if (field.setter == null) return;
     int getterFlags = field.getter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
     int setterFlags = field.setter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
-    if (getterFlags !== setterFlags) {
+    if (!identical(getterFlags, setterFlags)) {
       final mismatchedFlags =
         new Modifiers.withFlags(null, getterFlags ^ setterFlags);
       compiler.reportMessage(
           compiler.spanFromElement(field.getter),
           MessageKind.GETTER_MISMATCH.error([mismatchedFlags]),
-          api.Diagnostic.ERROR);
+          Diagnostic.ERROR);
       compiler.reportMessage(
           compiler.spanFromElement(field.setter),
           MessageKind.SETTER_MISMATCH.error([mismatchedFlags]),
-          api.Diagnostic.ERROR);
+          Diagnostic.ERROR);
     }
   }
 
@@ -540,15 +541,15 @@
         compiler.spanFromElement(errorneousElement),
         errorMessage.error([contextElement.name,
                             contextElement.getEnclosingClass().name]),
-        api.Diagnostic.ERROR);
+        Diagnostic.ERROR);
     compiler.reportMessage(
         compiler.spanFromElement(contextElement),
         contextMessage.error(),
-        api.Diagnostic.INFO);
+        Diagnostic.INFO);
   }
 
   void checkValidOverride(Element member, Element superMember) {
-    if (superMember === null) return;
+    if (superMember == null) return;
     if (member.modifiers.isStatic()) {
       reportErrorWithContext(
           member, MessageKind.NO_STATIC_OVERRIDE,
@@ -556,9 +557,9 @@
     } else {
       FunctionElement superFunction = superMember.asFunctionElement();
       FunctionElement function = member.asFunctionElement();
-      if (superFunction === null || superFunction.isAccessor()) {
+      if (superFunction == null || superFunction.isAccessor()) {
         // Field or accessor in super.
-        if (function !== null && !function.isAccessor()) {
+        if (function != null && !function.isAccessor()) {
           // But a plain method in this class.
           reportErrorWithContext(
               member, MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD,
@@ -566,7 +567,7 @@
         }
       } else {
         // Instance method in super.
-        if (function === null || function.isAccessor()) {
+        if (function == null || function.isAccessor()) {
           // But a field (or accessor) in this class.
           reportErrorWithContext(
               member, MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD,
@@ -696,7 +697,7 @@
     if (isFieldInitializer(init)) {
       Scope localScope = constructor.getEnclosingClass().buildLocalScope();
       target = localScope.lookup(name);
-      if (target === null) {
+      if (target == null) {
         error(selector, MessageKind.CANNOT_RESOLVE, [name]);
       } else if (target.kind != ElementKind.FIELD) {
         error(selector, MessageKind.NOT_A_FIELD, [name]);
@@ -719,7 +720,7 @@
     ClassElement lookupTarget = constructor.getEnclosingClass();
     if (isSuperCall) {
       // Calculate correct lookup target and constructor name.
-      if (lookupTarget === visitor.compiler.objectClass) {
+      if (identical(lookupTarget, visitor.compiler.objectClass)) {
         error(diagnosticNode, MessageKind.SUPER_INITIALIZER_IN_OBJECT);
       } else {
         return lookupTarget.supertype.element;
@@ -780,7 +781,7 @@
     ClassElement classElement = constructor.getEnclosingClass();
     ClassElement superClass = classElement.superclass;
     if (classElement != visitor.compiler.objectClass) {
-      assert(superClass !== null);
+      assert(superClass != null);
       assert(superClass.resolutionState == STATE_DONE);
       SourceString constructorName = const SourceString('');
       Selector callToMatch = new Selector.call(
@@ -816,7 +817,7 @@
       Node diagnosticNode,
       SourceString className,
       SourceString constructorName) {
-    if (lookedupConstructor === null
+    if (lookedupConstructor == null
         || !lookedupConstructor.isGenerativeConstructor()) {
       var fullConstructorName =
           visitor.compiler.resolver.constructorNameForDiagnostics(className,
@@ -837,7 +838,7 @@
 
   FunctionElement resolveRedirection(FunctionElement constructor,
                                      FunctionExpression functionNode) {
-    if (functionNode.initializers === null) return null;
+    if (functionNode.initializers == null) return null;
     Link<Node> link = functionNode.initializers.nodes;
     if (!link.isEmpty() && Initializers.isConstructorRedirect(link.head)) {
       return resolveSuperOrThisForSend(constructor, functionNode, link.head);
@@ -856,13 +857,13 @@
     FunctionSignature functionParameters =
         constructor.computeSignature(visitor.compiler);
     functionParameters.forEachParameter((Element element) {
-      if (element.kind === ElementKind.FIELD_PARAMETER) {
+      if (identical(element.kind, ElementKind.FIELD_PARAMETER)) {
         checkForDuplicateInitializers(element.name,
                                       element.parseNode(visitor.compiler));
       }
     });
 
-    if (functionNode.initializers === null) {
+    if (functionNode.initializers == null) {
       initializers = const Link<Node>();
     } else {
       initializers = functionNode.initializers.nodes;
@@ -875,7 +876,7 @@
       if (link.head.asSendSet() != null) {
         final SendSet init = link.head.asSendSet();
         resolveFieldInitializer(constructor, init);
-      } else if (link.head.asSend() !== null) {
+      } else if (link.head.asSend() != null) {
         final Send call = link.head.asSend();
         if (Initializers.isSuperConstructorCall(call)) {
           if (resolvedSuper) {
@@ -957,7 +958,7 @@
   LabeledStatementLabelScope(this.outer, this.labels);
   LabelElement lookup(String labelName) {
     LabelElement label = labels[labelName];
-    if (label !== null) return label;
+    if (label != null) return label;
     return outer.lookup(labelName);
   }
 }
@@ -970,7 +971,7 @@
 
   LabelElement lookup(String labelName) {
     LabelElement result = caseLabels[labelName];
-    if (result !== null) return result;
+    if (result != null) return result;
     return outer.lookup(labelName);
   }
 }
@@ -1054,23 +1055,23 @@
   }
 
   Element resolveTypeNameInternal(Scope scope, Identifier typeName, Send send) {
-    if (send !== null) {
+    if (send != null) {
       typeName = send.selector;
     }
-    if (typeName.source.stringValue === 'void') {
+    if (identical(typeName.source.stringValue, 'void')) {
       return compiler.types.voidType.element;
     } else if (
         // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support.
-        typeName.source.stringValue === 'Dynamic'
-        || typeName.source.stringValue === 'dynamic') {
+        identical(typeName.source.stringValue, 'Dynamic')
+        || identical(typeName.source.stringValue, 'dynamic')) {
       return compiler.dynamicClass;
-    } else if (send !== null) {
+    } else if (send != null) {
       Element e = scope.lookup(send.receiver.asIdentifier().source);
-      if (e !== null && e.kind === ElementKind.PREFIX) {
+      if (e != null && identical(e.kind, ElementKind.PREFIX)) {
         // The receiver is a prefix. Lookup in the imported members.
         PrefixElement prefix = e;
         return prefix.lookupLocalMember(typeName.source);
-      } else if (e !== null && e.kind === ElementKind.CLASS) {
+      } else if (e != null && identical(e.kind, ElementKind.CLASS)) {
         // The receiver is the class part of a named constructor.
         return e;
       } else {
@@ -1086,19 +1087,19 @@
   // TODO(johnniwinther): Should never return [null] but instead an erroneous
   // type.
   DartType resolveTypeAnnotation(TypeAnnotation node,
-                                 [Scope inScope, ClassElement inClass,
+                                 {Scope inScope, ClassElement inClass,
                                  onFailure(Node, MessageKind, [List arguments]),
-                                 whenResolved(Node, Type)]) {
-    if (onFailure === null) {
+                                 whenResolved(Node, Type)}) {
+    if (onFailure == null) {
       onFailure = (n, k, [arguments]) {};
     }
-    if (whenResolved === null) {
+    if (whenResolved == null) {
       whenResolved = (n, t) {};
     }
-    if (inClass !== null) {
+    if (inClass != null) {
       inScope = inClass.buildScope();
     }
-    if (inScope === null) {
+    if (inScope == null) {
       compiler.internalError('resolveTypeAnnotation: no scope specified');
     }
     return resolveTypeAnnotationInContext(inScope, node, onFailure,
@@ -1109,7 +1110,7 @@
                                           onFailure, whenResolved) {
     Element element = resolveTypeName(scope, node);
     DartType type;
-    if (element === null) {
+    if (element == null) {
       onFailure(node, MessageKind.CANNOT_RESOLVE_TYPE, [node.typeName]);
     } else if (element.isErroneous()) {
       ErroneousElement error = element;
@@ -1117,8 +1118,8 @@
     } else if (!element.impliesType()) {
       onFailure(node, MessageKind.NOT_A_TYPE, [node.typeName]);
     } else {
-      if (element === compiler.types.voidType.element ||
-          element === compiler.types.dynamicType.element) {
+      if (identical(element, compiler.types.voidType.element) ||
+          identical(element, compiler.types.dynamicType.element)) {
         type = element.computeType(compiler);
       } else if (element.isClass()) {
         ClassElement cls = element;
@@ -1188,7 +1189,7 @@
 
 class ResolverVisitor extends CommonResolverVisitor<Element> {
   final TreeElementMapping mapping;
-  final Element enclosingElement;
+  Element enclosingElement;
   final TypeResolver typeResolver;
   bool inInstanceContext;
   bool inCheckContext;
@@ -1230,7 +1231,7 @@
   // Create, or reuse an already created, statement element for a statement.
   TargetElement getOrCreateTargetElement(Node statement) {
     TargetElement element = mapping[statement];
-    if (element === null) {
+    if (element == null) {
       element = new TargetElement(statement,
                                   statementScope.nestingLevel,
                                   enclosingElement);
@@ -1290,7 +1291,7 @@
       return null;
     } else {
       Element element = lookup(node, node.source);
-      if (element === null) {
+      if (element == null) {
         if (!inInstanceContext) {
           element = warnAndCreateErroneousElement(node, node.source,
                                                   MessageKind.CANNOT_RESOLVE,
@@ -1310,7 +1311,7 @@
 
   Element visitTypeAnnotation(TypeAnnotation node) {
     DartType type = resolveTypeAnnotation(node);
-    if (type !== null) {
+    if (type != null) {
       if (inCheckContext) {
         compiler.enqueuer.resolution.registerIsCheck(type);
       }
@@ -1320,8 +1321,8 @@
   }
 
   Element defineElement(Node node, Element element,
-                        [bool doAddToScope = true]) {
-    compiler.ensure(element !== null);
+                        {bool doAddToScope: true}) {
+    compiler.ensure(element != null);
     mapping[node] = element;
     if (doAddToScope) {
       Element existing = scope.add(element);
@@ -1333,12 +1334,12 @@
   }
 
   Element useElement(Node node, Element element) {
-    if (element === null) return null;
+    if (element == null) return null;
     return mapping[node] = element;
   }
 
   DartType useType(TypeAnnotation annotation, DartType type) {
-    if (type !== null) {
+    if (type != null) {
       mapping.setType(annotation, type);
       useElement(annotation, type.element);
     }
@@ -1346,14 +1347,12 @@
   }
 
   void setupFunction(FunctionExpression node, FunctionElement function) {
-    // If [function] is the [enclosingElement], the [scope] has
-    // already been set in the constructor of [ResolverVisitor].
-    if (function != enclosingElement) scope = new MethodScope(scope, function);
+    scope = new MethodScope(scope, function);
 
     // Put the parameters in scope.
     FunctionSignature functionParameters =
         function.computeSignature(compiler);
-    Link<Node> parameterNodes = (node.parameters === null)
+    Link<Node> parameterNodes = (node.parameters == null)
         ? const Link<Node>() : node.parameters.nodes;
     functionParameters.forEachParameter((Element element) {
       if (element == functionParameters.optionalParameters.head) {
@@ -1434,7 +1433,7 @@
   }
 
   visitFunctionDeclaration(FunctionDeclaration node) {
-    assert(node.function.name !== null);
+    assert(node.function.name != null);
     visit(node.function);
     FunctionElement functionElement = mapping[node.function];
     // TODO(floitsch): this might lead to two errors complaining about
@@ -1445,28 +1444,20 @@
   visitFunctionExpression(FunctionExpression node) {
     visit(node.returnType);
     SourceString name;
-    if (node.name === null) {
+    if (node.name == null) {
       name = const SourceString("");
     } else {
       name = node.name.asIdentifier().source;
     }
-    // TODO(ahe): we shouldn't use the scope to get the enclosing element. This
-    // is currently needed so that nested functions get their correct enclosing
-    // element.
-    Element functionEnclosing = scope.element;
-    if (functionEnclosing.kind == ElementKind.VARIABLE_LIST) {
-      compiler.internalError("Bad enclosing element", node: node);
-    }
-    if (functionEnclosing.isLibrary()) {
-      // We are in a static initializers.
-      functionEnclosing = enclosingElement;
-    }
-    FunctionElement enclosing = new FunctionElement.node(
-        name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
-        functionEnclosing);
-    setupFunction(node, enclosing);
-    defineElement(node, enclosing, doAddToScope: node.name !== null);
 
+    FunctionElement function = new FunctionElement.node(
+        name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
+        enclosingElement);
+    setupFunction(node, function);
+    defineElement(node, function, doAddToScope: node.name !== null);
+
+    Element previousEnclosingElement = enclosingElement;
+    enclosingElement = function;
     // Run the body in a fresh statement scope.
     StatementScope oldScope = statementScope;
     statementScope = new StatementScope();
@@ -1474,6 +1465,7 @@
     statementScope = oldScope;
 
     scope = scope.parent;
+    enclosingElement = previousEnclosingElement;
   }
 
   visitIf(If node) {
@@ -1484,13 +1476,13 @@
 
   static bool isLogicalOperator(Identifier op) {
     String str = op.source.stringValue;
-    return (str === '&&' || str == '||' || str == '!');
+    return (identical(str, '&&') || str == '||' || str == '!');
   }
 
   Element resolveSend(Send node) {
     Selector selector = resolveSelector(node);
 
-    if (node.receiver === null) {
+    if (node.receiver == null) {
       // If this send is of the form "assert(expr);", then
       // this is an assertion.
       if (selector.isAssert()) {
@@ -1516,7 +1508,7 @@
 
     Element target;
     SourceString name = node.selector.asIdentifier().source;
-    if (name.stringValue === 'this') {
+    if (identical(name.stringValue, 'this')) {
       error(node.selector, MessageKind.GENERIC, ["expected an identifier"]);
     } else if (node.isSuperCall) {
       if (node.isOperator) {
@@ -1530,7 +1522,7 @@
         error(node.receiver, MessageKind.NO_INSTANCE_AVAILABLE, [name]);
         return null;
       }
-      if (currentClass.supertype === null) {
+      if (currentClass.supertype == null) {
         // This is just to guard against internal errors, so no need
         // for a real error message.
         error(node.receiver, MessageKind.GENERIC, ["Object has no superclass"]);
@@ -1542,11 +1534,11 @@
       // super.
     } else if (Elements.isUnresolved(resolvedReceiver)) {
       return null;
-    } else if (resolvedReceiver.kind === ElementKind.CLASS) {
+    } else if (identical(resolvedReceiver.kind, ElementKind.CLASS)) {
       ClassElement receiverClass = resolvedReceiver;
       receiverClass.ensureResolved(compiler);
       target = receiverClass.buildLocalScope().lookup(name);
-      if (target === null) {
+      if (target == null) {
         // TODO(johnniwinther): With the simplified [TreeElements] invariant,
         // try to resolve injected elements if [currentClass] is in the patch
         // library of [receiverClass].
@@ -1560,7 +1552,7 @@
       } else if (target.isInstanceMember()) {
         error(node, MessageKind.MEMBER_NOT_STATIC, [receiverClass.name, name]);
       }
-    } else if (resolvedReceiver.kind === ElementKind.PREFIX) {
+    } else if (identical(resolvedReceiver.kind, ElementKind.PREFIX)) {
       PrefixElement prefix = resolvedReceiver;
       target = prefix.lookupLocalMember(name);
       if (target == null) {
@@ -1572,17 +1564,17 @@
 
   DartType resolveTypeTest(Node argument) {
     TypeAnnotation node = argument.asTypeAnnotation();
-    if (node === null) {
+    if (node == null) {
       // node is of the form !Type.
       node = argument.asSend().receiver.asTypeAnnotation();
-      if (node === null) compiler.cancel("malformed send");
+      if (node == null) compiler.cancel("malformed send");
     }
     return resolveTypeRequired(node);
   }
 
   static Selector computeSendSelector(Send node, LibraryElement library) {
     // First determine if this is part of an assignment.
-    bool isSet = node.asSendSet() !== null;
+    bool isSet = node.asSendSet() != null;
 
     if (node.isIndex) {
       return isSet ? new Selector.indexSet() : new Selector.index();
@@ -1591,10 +1583,10 @@
     if (node.isOperator) {
       SourceString source = node.selector.asOperator().source;
       String string = source.stringValue;
-      if (string === '!'   || string === '&&'  || string == '||' ||
-          string === 'is'  || string === 'as'  ||
-          string === '===' || string === '!==' ||
-          string === '>>>') {
+      if (identical(string, '!')   || identical(string, '&&')  || string == '||' ||
+          identical(string, 'is')  || identical(string, 'as')  ||
+          identical(string, '===') || identical(string, '!==') ||
+          identical(string, '>>>')) {
         return null;
       }
       return node.arguments.isEmpty()
@@ -1618,14 +1610,14 @@
         link = link.tail) {
       Expression argument = link.head;
       NamedArgument namedArgument = argument.asNamedArgument();
-      if (namedArgument !== null) {
+      if (namedArgument != null) {
         named.add(namedArgument.name.source);
       }
       arity++;
     }
 
     // If we're invoking a closure, we do not have an identifier.
-    return (identifier === null)
+    return (identifier == null)
         ? new Selector.callClosure(arity, named)
         : new Selector.call(identifier.source, library, arity, named);
   }
@@ -1638,7 +1630,7 @@
   }
 
   void resolveArguments(NodeList list) {
-    if (list === null) return;
+    if (list == null) return;
     bool seenNamedArgument = false;
     for (Link<Node> link = list.nodes; !link.isEmpty(); link = link.tail) {
       Expression argument = link.head;
@@ -1668,16 +1660,17 @@
     bool resolvedArguments = false;
     if (node.isOperator) {
       String operatorString = node.selector.asOperator().source.stringValue;
-      if (operatorString === 'is' || operatorString === 'as') {
+      if (identical(operatorString, 'is') || identical(operatorString, 'as')) {
         assert(node.arguments.tail.isEmpty());
         DartType type = resolveTypeTest(node.arguments.head);
         if (type != null) {
           compiler.enqueuer.resolution.registerIsCheck(type);
         }
         resolvedArguments = true;
-      } else if (operatorString === '?') {
+      } else if (identical(operatorString, '?')) {
         Element parameter = mapping[node.receiver];
-        if (parameter === null || parameter.kind !== ElementKind.PARAMETER) {
+        if (parameter == null
+            || !identical(parameter.kind, ElementKind.PARAMETER)) {
           error(node.receiver, MessageKind.PARAMETER_NAME_EXPECTED);
         } else {
           mapping.checkedParameters.add(parameter);
@@ -1692,7 +1685,7 @@
     // If the selector is null, it means that we will not be generating
     // code for this as a send.
     Selector selector = mapping.getSelector(node);
-    if (selector === null) return;
+    if (selector == null) return;
 
     // If we don't know what we're calling or if we are calling a getter,
     // we need to register that fact that we may be calling a closure
@@ -1718,7 +1711,7 @@
     Element getter = target;
     SourceString operatorName = node.assignmentOperator.source;
     String source = operatorName.stringValue;
-    bool isComplex = source !== '=';
+    bool isComplex = !identical(source, '=');
     if (!Elements.isUnresolved(target)
         && target.kind == ElementKind.ABSTRACT_FIELD) {
       AbstractFieldElement field = target;
@@ -1771,8 +1764,8 @@
         Selector binop = new Selector.binaryOperator(name);
         world.registerDynamicInvocation(binop.name, binop);
       }
-      if (source === '++') registerBinaryOperator(const SourceString('+'));
-      if (source === '--') registerBinaryOperator(const SourceString('-'));
+      if (identical(source, '++')) registerBinaryOperator(const SourceString('+'));
+      if (identical(source, '--')) registerBinaryOperator(const SourceString('-'));
       if (source.endsWith('=')) {
         registerBinaryOperator(Elements.mapToUserOperator(operatorName));
       }
@@ -1783,7 +1776,7 @@
   }
 
   void registerSend(Selector selector, Element target) {
-    if (target === null || target.isInstanceMember()) {
+    if (target == null || target.isInstanceMember()) {
       if (selector.isGetter()) {
         world.registerDynamicGetter(selector.name, selector);
       } else if (selector.isSetter()) {
@@ -1838,14 +1831,14 @@
   }
 
   visitReturn(Return node) {
-    if (node.isRedirectingConstructorBody) {
+    if (node.isRedirectingFactoryBody) {
       unimplemented(node, 'redirecting constructors');
     }
     visit(node.expression);
   }
 
   visitThrow(Throw node) {
-    if (!inCatchBlock && node.expression === null) {
+    if (!inCatchBlock && node.expression == null) {
       error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
     }
     visit(node.expression);
@@ -1898,11 +1891,11 @@
     // [cls] might be the declaration element and we want to include injected
     // members.
     cls.implementation.forEachInstanceField(
-        includeBackendMembers: false,
-        includeSuperMembers: true,
-        f: (ClassElement enclosingClass, Element member) {
+        (ClassElement enclosingClass, Element member) {
           world.addToWorkList(member);
-        });
+        },
+        includeBackendMembers: false,
+        includeSuperMembers: true);
     return null;
   }
 
@@ -1995,7 +1988,7 @@
 
   visitLiteralList(LiteralList node) {
     NodeList arguments = node.typeArguments;
-    if (arguments !== null) {
+    if (arguments != null) {
       Link<Node> nodes = arguments.nodes;
       if (nodes.isEmpty()) {
         error(arguments, MessageKind.MISSING_TYPE_ARGUMENT, []);
@@ -2025,9 +2018,9 @@
 
   visitBreakStatement(BreakStatement node) {
     TargetElement target;
-    if (node.target === null) {
+    if (node.target == null) {
       target = statementScope.currentBreakTarget();
-      if (target === null) {
+      if (target == null) {
         error(node, MessageKind.NO_BREAK_TARGET);
         return;
       }
@@ -2035,7 +2028,7 @@
     } else {
       String labelName = node.target.source.slowToString();
       LabelElement label = statementScope.lookupLabel(labelName);
-      if (label === null) {
+      if (label == null) {
         error(node.target, MessageKind.UNBOUND_LABEL, [labelName]);
         return;
       }
@@ -2052,9 +2045,9 @@
 
   visitContinueStatement(ContinueStatement node) {
     TargetElement target;
-    if (node.target === null) {
+    if (node.target == null) {
       target = statementScope.currentContinueTarget();
-      if (target === null) {
+      if (target == null) {
         error(node, MessageKind.NO_CONTINUE_TARGET);
         return;
       }
@@ -2062,7 +2055,7 @@
     } else {
       String labelName = node.target.source.slowToString();
       LabelElement label = statementScope.lookupLabel(labelName);
-      if (label === null) {
+      if (label == null) {
         error(node.target, MessageKind.UNBOUND_LABEL, [labelName]);
         return;
       }
@@ -2134,7 +2127,7 @@
         warning(element.label, MessageKind.UNUSED_LABEL, [labelName]);
       }
     });
-    if (!targetElement.isTarget && mapping[body] === targetElement) {
+    if (!targetElement.isTarget && identical(mapping[body], targetElement)) {
       // If the body is itself a break or continue for another target, it
       // might have updated its mapping to the target it actually does target.
       mapping.remove(body);
@@ -2167,14 +2160,14 @@
         String labelName = label.slowToString();
 
         LabelElement existingElement = continueLabels[labelName];
-        if (existingElement !== null) {
+        if (existingElement != null) {
           // It's an error if the same label occurs twice in the same switch.
           warning(label, MessageKind.DUPLICATE_LABEL, [labelName]);
           error(existingElement.label, MessageKind.EXISTING_LABEL, [labelName]);
         } else {
           // It's only a warning if it shadows another label.
           existingElement = statementScope.lookupLabel(labelName);
-          if (existingElement !== null) {
+          if (existingElement != null) {
             warning(label, MessageKind.DUPLICATE_LABEL, [labelName]);
             warning(existingElement.label,
                     MessageKind.EXISTING_LABEL, [labelName]);
@@ -2195,7 +2188,7 @@
       }
       cases = cases.tail;
       // Test that only the last case, if any, is a default case.
-      if (switchCase.defaultKeyword !== null && !cases.isEmpty()) {
+      if (switchCase.defaultKeyword != null && !cases.isEmpty()) {
         error(switchCase, MessageKind.INVALID_CASE_DEFAULT);
       }
     }
@@ -2238,7 +2231,7 @@
   visitCatchBlock(CatchBlock node) {
     // Check that if catch part is present, then
     // it has one or two formal parameters.
-    if (node.formals !== null) {
+    if (node.formals != null) {
       if (node.formals.isEmpty()) {
         error(node, MessageKind.EMPTY_CATCH_DECLARATION);
       }
@@ -2257,7 +2250,7 @@
         // If the formal parameter is a node list, it means that it is a
         // sequence of optional parameters.
         NodeList nodeList = link.head.asNodeList();
-        if (nodeList !== null) {
+        if (nodeList != null) {
           error(nodeList, MessageKind.OPTIONAL_PARAMETER_IN_CATCH);
         } else {
         VariableDefinitions declaration = link.head;
@@ -2265,7 +2258,7 @@
             error(modifier, MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH);
           }
           TypeAnnotation type = declaration.type;
-          if (type !== null) {
+          if (type != null) {
             error(type, MessageKind.PARAMETER_WITH_TYPE_IN_CATCH);
           }
         }
@@ -2301,7 +2294,7 @@
         super(compiler);
 
   void resolveTypeVariableBounds(NodeList node) {
-    if (node === null) return;
+    if (node == null) return;
 
     var nameSet = new Set<SourceString>();
     // Resolve the bounds of type variables.
@@ -2317,15 +2310,15 @@
       nameSet.add(typeName);
 
       TypeVariableElement variableElement = typeVariable.element;
-      if (typeNode.bound !== null) {
+      if (typeNode.bound != null) {
         DartType boundType = typeResolver.resolveTypeAnnotation(
             typeNode.bound, inScope: scope, onFailure: warning);
-        if (boundType !== null && boundType.element == variableElement) {
+        if (boundType != null && boundType.element == variableElement) {
           // TODO(johnniwinther): Check for more general cycles, like
           // [: <A extends B, B extends C, C extends B> :].
           warning(node, MessageKind.CYCLIC_TYPE_VARIABLE,
                   [variableElement.name]);
-        } else if (boundType !== null) {
+        } else if (boundType != null) {
           variableElement.bound = boundType;
         } else {
           // TODO(johnniwinther): Should be an erroneous type.
@@ -2381,7 +2374,7 @@
     : super(compiler, classElement);
 
   DartType visitClassNode(ClassNode node) {
-    compiler.ensure(element !== null);
+    compiler.ensure(element != null);
     compiler.ensure(element.resolutionState == STATE_STARTED);
 
     InterfaceType type = element.computeType(compiler);
@@ -2393,17 +2386,17 @@
 
     // Find super type.
     DartType supertype = visit(node.superclass);
-    if (supertype !== null && supertype.element.isExtendable()) {
+    if (supertype != null && supertype.element.isExtendable()) {
       element.supertype = supertype;
       if (isBlackListed(supertype)) {
         error(node.superclass, MessageKind.CANNOT_EXTEND, [supertype]);
       }
-    } else if (supertype !== null) {
+    } else if (supertype != null) {
       error(node.superclass, MessageKind.TYPE_NAME_EXPECTED);
     }
     final objectElement = compiler.objectClass;
-    if (element !== objectElement && element.supertype === null) {
-      if (objectElement === null) {
+    if (!identical(element, objectElement) && element.supertype == null) {
+      if (objectElement == null) {
         compiler.internalError("Internal error: cannot resolve Object",
                                node: node);
       } else {
@@ -2412,13 +2405,13 @@
       // TODO(ahe): This should be objectElement.computeType(...).
       element.supertype = new InterfaceType(objectElement);
     }
-    assert(element.interfaces === null);
+    assert(element.interfaces == null);
     Link<DartType> interfaces = const Link<DartType>();
     for (Link<Node> link = node.interfaces.nodes;
          !link.isEmpty();
          link = link.tail) {
       DartType interfaceType = visit(link.head);
-      if (interfaceType !== null && interfaceType.element.isExtendable()) {
+      if (interfaceType != null && interfaceType.element.isExtendable()) {
         interfaces = interfaces.prepend(interfaceType);
         if (isBlackListed(interfaceType)) {
           error(link.head, MessageKind.CANNOT_IMPLEMENT, [interfaceType]);
@@ -2430,7 +2423,7 @@
     element.interfaces = interfaces;
     calculateAllSupertypes(element);
 
-    if (node.defaultClause !== null) {
+    if (node.defaultClause != null) {
       element.defaultClass = visit(node.defaultClause);
     }
     addDefaultConstructorIfNeeded(element);
@@ -2443,7 +2436,7 @@
 
   DartType visitIdentifier(Identifier node) {
     Element element = scope.lookup(node.source);
-    if (element === null) {
+    if (element == null) {
       error(node, MessageKind.CANNOT_RESOLVE_TYPE, [node]);
       return null;
     } else if (!element.impliesType() && !element.isTypeVariable()) {
@@ -2465,19 +2458,19 @@
 
   DartType visitSend(Send node) {
     Identifier prefix = node.receiver.asIdentifier();
-    if (prefix === null) {
+    if (prefix == null) {
       error(node.receiver, MessageKind.NOT_A_PREFIX, [node.receiver]);
       return null;
     }
     Element element = scope.lookup(prefix.source);
-    if (element === null || element.kind !== ElementKind.PREFIX) {
+    if (element == null || !identical(element.kind, ElementKind.PREFIX)) {
       error(node.receiver, MessageKind.NOT_A_PREFIX, [node.receiver]);
       return null;
     }
     PrefixElement prefixElement = element;
     Identifier selector = node.selector.asIdentifier();
     var e = prefixElement.lookupLocalMember(selector.source);
-    if (e === null || !e.impliesType()) {
+    if (e == null || !e.impliesType()) {
       error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE, [node.selector]);
       return null;
     }
@@ -2488,25 +2481,25 @@
     // TODO(karlklose): substitute type variables.
     // TODO(karlklose): check if type arguments match, if a classelement occurs
     //                  more than once in the supertypes.
-    if (cls.allSupertypes !== null) return;
+    if (cls.allSupertypes != null) return;
     final DartType supertype = cls.supertype;
     if (supertype != null) {
       ClassElement superElement = supertype.element;
       Link<DartType> superSupertypes = superElement.allSupertypes;
-      assert(superSupertypes !== null);
+      assert(superSupertypes != null);
       Link<DartType> supertypes = superSupertypes.prepend(supertype);
       for (Link<DartType> interfaces = cls.interfaces;
            !interfaces.isEmpty();
            interfaces = interfaces.tail) {
         ClassElement element = interfaces.head.element;
         Link<DartType> interfaceSupertypes = element.allSupertypes;
-        assert(interfaceSupertypes !== null);
+        assert(interfaceSupertypes != null);
         supertypes = supertypes.reversePrependAll(interfaceSupertypes);
         supertypes = supertypes.prepend(interfaces.head);
       }
       cls.allSupertypes = supertypes;
     } else {
-      assert(cls === compiler.objectClass);
+      assert(identical(cls, compiler.objectClass));
       cls.allSupertypes = const Link<DartType>();
     }
   }
@@ -2533,17 +2526,17 @@
   isBlackListed(DartType type) {
     LibraryElement lib = element.getLibrary();
     return
-      lib !== compiler.coreLibrary &&
-      lib !== compiler.coreImplLibrary &&
-      lib !== compiler.jsHelperLibrary &&
-      (type.element === compiler.dynamicClass ||
-       type.element === compiler.boolClass ||
-       type.element === compiler.numClass ||
-       type.element === compiler.intClass ||
-       type.element === compiler.doubleClass ||
-       type.element === compiler.stringClass ||
-       type.element === compiler.nullClass ||
-       type.element === compiler.functionClass);
+      !identical(lib, compiler.coreLibrary) &&
+      !identical(lib, compiler.coreImplLibrary) &&
+      !identical(lib, compiler.jsHelperLibrary) &&
+      (identical(type.element, compiler.dynamicClass) ||
+       identical(type.element, compiler.boolClass) ||
+       identical(type.element, compiler.numClass) ||
+       identical(type.element, compiler.intClass) ||
+       identical(type.element, compiler.doubleClass) ||
+       identical(type.element, compiler.stringClass) ||
+       identical(type.element, compiler.nullClass) ||
+       identical(type.element, compiler.functionClass));
   }
 }
 
@@ -2562,8 +2555,8 @@
   }
 
   void visitClassNode(ClassNode node) {
-    if (node.superclass === null) {
-      if (classElement !== compiler.objectClass) {
+    if (node.superclass == null) {
+      if (!identical(classElement, compiler.objectClass)) {
         loadSupertype(compiler.objectClass, node);
       }
     } else {
@@ -2582,7 +2575,7 @@
 
   void visitIdentifier(Identifier node) {
     Element element = context.lookup(node.source);
-    if (element === null) {
+    if (element == null) {
       error(node, MessageKind.CANNOT_RESOLVE_TYPE, [node]);
     } else if (!element.impliesType()) {
       error(node, MessageKind.NOT_A_TYPE, [node]);
@@ -2593,26 +2586,26 @@
         compiler.reportMessage(
           compiler.spanFromNode(node),
           MessageKind.TYPE_NAME_EXPECTED.error([]),
-          api.Diagnostic.ERROR);
+          Diagnostic.ERROR);
       }
     }
   }
 
   void visitSend(Send node) {
     Identifier prefix = node.receiver.asIdentifier();
-    if (prefix === null) {
+    if (prefix == null) {
       error(node.receiver, MessageKind.NOT_A_PREFIX, [node.receiver]);
       return;
     }
     Element element = context.lookup(prefix.source);
-    if (element === null || element.kind !== ElementKind.PREFIX) {
+    if (element == null || !identical(element.kind, ElementKind.PREFIX)) {
       error(node.receiver, MessageKind.NOT_A_PREFIX, [node.receiver]);
       return;
     }
     PrefixElement prefixElement = element;
     Identifier selector = node.selector.asIdentifier();
     var e = prefixElement.lookupLocalMember(selector.source);
-    if (e === null || !e.impliesType()) {
+    if (e == null || !e.impliesType()) {
       error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE, [node.selector]);
       return;
     }
@@ -2644,8 +2637,8 @@
   visitNodeList(NodeList node) {
     for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) {
       SourceString name = visit(link.head);
-      VariableElement element = new VariableElement(
-          name, variables, kind, resolver.scope.element, node: link.head);
+      VariableElement element =
+          new VariableElement(name, variables, kind, link.head);
       resolver.defineElement(link.head, element);
     }
   }
@@ -2666,10 +2659,10 @@
   Element visitNodeList(NodeList node) {
     // This must be a list of optional arguments.
     String value = node.beginToken.stringValue;
-    if ((value !== '[') && (value !== '{')) {
+    if ((!identical(value, '[')) && (!identical(value, '{'))) {
       internalError(node, "expected optional parameters");
     }
-    optionalParametersAreNamed = (value === '{');
+    optionalParametersAreNamed = (identical(value, '{'));
     LinkBuilder<Element> elements = analyzeNodes(node.nodes);
     optionalParameterCount = elements.length;
     optionalParameters = elements.toLink();
@@ -2706,19 +2699,19 @@
     // Ensure a parameter is not typed 'void'.
     variables.computeType(compiler);
     return new VariableElement(node.source, variables,
-        ElementKind.PARAMETER, enclosingElement, node: node);
+        ElementKind.PARAMETER, node);
   }
 
   SourceString getParameterName(Send node) {
     var identifier = node.selector.asIdentifier();
-    if (identifier !== null) {
+    if (identifier != null) {
       // Normal parameter: [:Type name:].
       return identifier.source;
     } else {
       // Function type parameter: [:void name(DartType arg):].
       var functionExpression = node.selector.asFunctionExpression();
-      if (functionExpression !== null &&
-          functionExpression.name.asIdentifier() !== null) {
+      if (functionExpression != null &&
+          functionExpression.name.asIdentifier() != null) {
         return functionExpression.name.asIdentifier().source;
       } else {
         cancel(node,
@@ -2731,23 +2724,22 @@
   // [:this.x:] (where [:x:] represents an instance field).
   FieldParameterElement visitSend(Send node) {
     FieldParameterElement element;
-    if (node.receiver.asIdentifier() === null ||
+    if (node.receiver.asIdentifier() == null ||
         !node.receiver.asIdentifier().isThis()) {
       error(node, MessageKind.INVALID_PARAMETER, []);
-    } else if (enclosingElement.kind !== ElementKind.GENERATIVE_CONSTRUCTOR) {
+    } else if (!identical(enclosingElement.kind, ElementKind.GENERATIVE_CONSTRUCTOR)) {
       error(node, MessageKind.FIELD_PARAMETER_NOT_ALLOWED, []);
     } else {
       SourceString name = getParameterName(node);
       Element fieldElement = currentClass.lookupLocalMember(name);
-      if (fieldElement === null || fieldElement.kind !== ElementKind.FIELD) {
+      if (fieldElement == null || !identical(fieldElement.kind, ElementKind.FIELD)) {
         error(node, MessageKind.NOT_A_FIELD, [name]);
       } else if (!fieldElement.isInstanceMember()) {
         error(node, MessageKind.NOT_INSTANCE_FIELD, [name]);
       }
       Element variables = new VariableListElement.node(currentDefinitions,
           ElementKind.VARIABLE_LIST, enclosingElement);
-      element = new FieldParameterElement(name,
-          fieldElement, variables, enclosingElement, node);
+      element = new FieldParameterElement(name, fieldElement, variables, node);
     }
     return element;
   }
@@ -2760,7 +2752,7 @@
       Element variables = new VariableListElement.node(currentDefinitions,
           ElementKind.VARIABLE_LIST, enclosingElement);
       element = new VariableElement(node.selector.asIdentifier().source,
-          variables, ElementKind.PARAMETER, enclosingElement, node: node);
+          variables, ElementKind.PARAMETER, node);
     }
     // Visit the value. The compile time constant handler will
     // make sure it's a compile time constant.
@@ -2801,21 +2793,21 @@
     SignatureResolver visitor = new SignatureResolver(compiler, element);
     Link<Element> parameters = const Link<Element>();
     int requiredParameterCount = 0;
-    if (formalParameters === null) {
+    if (formalParameters == null) {
       if (!element.isGetter()) {
         compiler.reportMessage(compiler.spanFromElement(element),
                                MessageKind.MISSING_FORMALS.error([]),
-                               api.Diagnostic.ERROR);
+                               Diagnostic.ERROR);
       }
     } else {
       if (element.isGetter()) {
         if (!element.getLibrary().isPlatformLibrary) {
           // TODO(ahe): Remove the isPlatformLibrary check.
-          if (formalParameters.getEndToken().next.stringValue !== 'native') {
+          if (!identical(formalParameters.getEndToken().next.stringValue, 'native')) {
             // TODO(ahe): Remove the check for native keyword.
             compiler.reportMessage(compiler.spanFromNode(formalParameters),
                                    MessageKind.EXTRA_FORMALS.error([]),
-                                   api.Diagnostic.WARNING);
+                                   Diagnostic.WARNING);
           }
         }
       }
@@ -2889,7 +2881,7 @@
     cls.ensureResolved(compiler);
     Selector selector = createConstructorSelector(constructorName);
     Element result = cls.lookupConstructor(selector);
-    if (result === null) {
+    if (result == null) {
       String fullConstructorName =
           resolver.compiler.resolver.constructorNameForDiagnostics(
               cls.name,
@@ -2909,10 +2901,10 @@
   visitNewExpression(NewExpression node) {
     Node selector = node.send.selector;
     Element e = visit(selector);
-    if (!Elements.isUnresolved(e) && e.kind === ElementKind.CLASS) {
+    if (!Elements.isUnresolved(e) && identical(e.kind, ElementKind.CLASS)) {
       ClassElement cls = e;
       cls.ensureResolved(compiler);
-      if (cls.isInterface() && (cls.defaultClass === null)) {
+      if (cls.isInterface() && (cls.defaultClass == null)) {
         error(selector, MessageKind.CANNOT_INSTANTIATE_INTERFACE, [cls.name]);
       }
       e = lookupConstructor(cls, selector, const SourceString(''));
@@ -2928,25 +2920,25 @@
     Element e = visit(node.receiver);
     if (Elements.isUnresolved(e)) return e;
     Identifier name = node.selector.asIdentifier();
-    if (name === null) internalError(node.selector, 'unexpected node');
+    if (name == null) internalError(node.selector, 'unexpected node');
 
-    if (e.kind === ElementKind.CLASS) {
+    if (identical(e.kind, ElementKind.CLASS)) {
       ClassElement cls = e;
       cls.ensureResolved(compiler);
-      if (cls.isInterface() && (cls.defaultClass === null)) {
+      if (cls.isInterface() && (cls.defaultClass == null)) {
         error(node.receiver, MessageKind.CANNOT_INSTANTIATE_INTERFACE,
               [cls.name]);
       }
       return lookupConstructor(cls, name, name.source);
-    } else if (e.kind === ElementKind.PREFIX) {
+    } else if (identical(e.kind, ElementKind.PREFIX)) {
       PrefixElement prefix = e;
       e = prefix.lookupLocalMember(name.source);
-      if (e === null) {
+      if (e == null) {
         return failOrReturnErroneousElement(resolver.enclosingElement, name,
                                             name.source,
                                             MessageKind.CANNOT_RESOLVE,
                                             [name]);
-      } else if (e.kind !== ElementKind.CLASS) {
+      } else if (!identical(e.kind, ElementKind.CLASS)) {
         error(node, MessageKind.NOT_A_TYPE, [name]);
       }
     } else {
@@ -2958,12 +2950,16 @@
   Element visitIdentifier(Identifier node) {
     SourceString name = node.source;
     Element e = resolver.lookup(node, name);
-    if (e === null) {
+    // TODO(johnniwinther): Change errors to warnings, cf. 11.11.1.
+    if (e == null) {
       return failOrReturnErroneousElement(resolver.enclosingElement, node, name,
                                           MessageKind.CANNOT_RESOLVE, [name]);
-    } else if (e.kind === ElementKind.TYPEDEF) {
+    } else if (identical(e.kind, ElementKind.TYPEDEF)) {
       error(node, MessageKind.CANNOT_INSTANTIATE_TYPEDEF, [name]);
-    } else if (e.kind !== ElementKind.CLASS && e.kind !== ElementKind.PREFIX) {
+    } else if (identical(e.kind, ElementKind.TYPE_VARIABLE)) {
+      error(node, MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE, [name]);
+    } else if (!identical(e.kind, ElementKind.CLASS)
+        && !identical(e.kind, ElementKind.PREFIX)) {
       error(node, MessageKind.NOT_A_TYPE, [name]);
     }
     return e;
@@ -2983,27 +2979,9 @@
     return parent.lookup(name);
   }
 
-  Element lexicalLookup(SourceString name) {
-    Element result = localLookup(name);
-    if (result != null) return result;
-    return parent.lexicalLookup(name);
-  }
-
   abstract Element localLookup(SourceString name);
 }
 
-class VariableScope extends Scope {
-  VariableScope(parent, element) : super(parent, element);
-
-  Element add(Element newElement) {
-    throw "Cannot add element to VariableScope";
-  }
-
-  Element localLookup(SourceString name) => null;
-
-  String toString() => '$element > $parent';
-}
-
 /**
  * [TypeDeclarationScope] defines the outer scope of a type declaration in
  * which the declared type variables and the entities in the enclosing scope are
@@ -3016,7 +2994,7 @@
 
   TypeDeclarationScope(parent, TypeDeclarationElement element)
       : super(parent, element) {
-    assert(parent !== null);
+    assert(parent != null);
   }
 
   Element add(Element newElement) {
@@ -3045,7 +3023,7 @@
   MethodScope(Scope parent, Element element)
       : super(parent, element),
         this.elements = new Map<SourceString, Element>() {
-    assert(parent !== null);
+    assert(parent != null);
   }
 
   Element localLookup(SourceString name) => elements[name];
@@ -3073,33 +3051,25 @@
  * scope and inherited members are available, in the given order.
  */
 class ClassScope extends TypeDeclarationScope {
-  bool inStaticContext = false;
+  ClassElement get element => super.element;
 
   ClassScope(Scope parentScope, ClassElement element)
       : super(parentScope, element)  {
-    assert(parent !== null);
+    assert(parent != null);
   }
 
   Element localLookup(SourceString name) {
-    ClassElement cls = element;
-    Element result = cls.lookupLocalMember(name);
-    if (result !== null) return result;
-    if (!inStaticContext) {
-      // If not in a static context, we can lookup in the
-      // TypeDeclaration scope, which contains the type variables of
-      // the class.
-      result = super.localLookup(name);
-    }
-    return result;
+    Element result = element.lookupLocalMember(name);
+    if (result != null) return result;
+    return super.localLookup(name);
   }
 
   Element lookup(SourceString name) {
     Element result = localLookup(name);
-    if (result !== null) return result;
+    if (result != null) return result;
     result = parent.lookup(name);
-    if (result !== null) return result;
-    ClassElement cls = element;
-    return cls.lookupSuperMember(name);
+    if (result != null) return result;
+    return element.lookupSuperMember(name);
   }
 
   Element add(Element newElement) {
@@ -3111,36 +3081,30 @@
 
 // TODO(johnniwinther): Refactor scopes to avoid class explosion.
 class PatchClassScope extends TypeDeclarationScope {
-  bool inStaticContext = false;
   ClassElement get origin => element;
   final ClassElement patch;
 
   PatchClassScope(Scope parentScope,
                   ClassElement origin, ClassElement this.patch)
       : super(parentScope, origin) {
-    assert(parent !== null);
+    assert(parent != null);
   }
 
   Element localLookup(SourceString name) {
     Element result = patch.lookupLocalMember(name);
-    if (result !== null) return result;
+    if (result != null) return result;
     result = origin.lookupLocalMember(name);
-    if (result !== null) return result;
-    if (!inStaticContext) {
-      // If not in a static context, we can lookup in the
-      // TypeDeclaration scope, which contains the type variables of
-      // the class.
-      result = super.localLookup(name);
-      if (result !== null) return result;
-    }
+    if (result != null) return result;
+    result = super.localLookup(name);
+    if (result != null) return result;
     result = parent.lookup(name);
-    if (result !== null) return result;
+    if (result != null) return result;
     return result;
   }
 
   Element lookup(SourceString name) {
     Element result = localLookup(name);
-    if (result !== null) return result;
+    if (result != null) return result;
     // TODO(johnniwinther): Should we support patch lookup on supertypes?
     return origin.lookupSuperMember(name);
   }
@@ -3181,11 +3145,10 @@
 
   Element localLookup(SourceString name) {
     Element result = patch.lookupLocalMember(name);
-    if (result !== null) return result;
+    if (result != null) return result;
     return origin.lookupLocalMember(name);
   }
 
-
   Element add(Element newElement) {
     throw "Cannot add an element in a class scope";
   }
@@ -3217,11 +3180,11 @@
 
   Element localLookup(SourceString name) {
     Element result = patch.find(name);
-    if (result !== null) {
+    if (result != null) {
       return result;
     }
     result = origin.find(name);
-    if (result !== null) {
+    if (result != null) {
       return result;
     }
     return result;
diff --git a/lib/compiler/implementation/resolution/resolution.dart b/lib/compiler/implementation/resolution/resolution.dart
new file mode 100644
index 0000000..832090c
--- /dev/null
+++ b/lib/compiler/implementation/resolution/resolution.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2012, 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 resolution;
+
+import '../dart2jslib.dart' hide Diagnostic;
+import '../../compiler.dart' show Diagnostic;
+import '../tree/tree.dart';
+import '../elements/elements.dart';
+import '../util/util.dart';
+import '../scanner/scannerlib.dart' show PartialMetadataAnnotation;
+
+part 'members.dart';
diff --git a/lib/compiler/implementation/resolved_visitor.dart b/lib/compiler/implementation/resolved_visitor.dart
index b00059e..47fcb88 100644
--- a/lib/compiler/implementation/resolved_visitor.dart
+++ b/lib/compiler/implementation/resolved_visitor.dart
@@ -31,7 +31,7 @@
       } else if (element.isInstanceMember()) {
         // Example: f() with 'f' bound to instance method.
         return visitDynamicSend(node);
-      } else if (element.kind === ElementKind.FOREIGN) {
+      } else if (identical(element.kind, ElementKind.FOREIGN)) {
         return visitForeignSend(node);
       } else if (!element.isInstanceMember()) {
         // Example: A.f() or f() with 'f' bound to a static function.
@@ -52,9 +52,9 @@
   abstract R visitForeignSend(Send node);
   abstract R visitStaticSend(Send node);
 
-  abstract void internalError(String reason, [Node node]);
+  abstract void internalError(String reason, {Node node});
 
   R visitNode(Node node) {
-    internalError("Unhandled node", node);
+    internalError("Unhandled node", node: node);
   }
 }
diff --git a/lib/compiler/implementation/runtime_types.dart b/lib/compiler/implementation/runtime_types.dart
index 9f51ec4..e1a51e6 100644
--- a/lib/compiler/implementation/runtime_types.dart
+++ b/lib/compiler/implementation/runtime_types.dart
@@ -2,13 +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.
 
-#library('runtime_types');
+library runtime_types;
 
-#import('leg.dart');
-#import('elements/elements.dart');
-#import('tree/tree.dart');
-#import('universe/universe.dart');
-#import('util/util.dart');
+import 'dart2jslib.dart';
+import 'elements/elements.dart';
+import 'tree/tree.dart';
+import 'universe/universe.dart';
+import 'util/util.dart';
 
 class RuntimeTypeInformation {
   /**
diff --git a/lib/compiler/implementation/scanner/array_based_scanner.dart b/lib/compiler/implementation/scanner/array_based_scanner.dart
index 3b6cff2..0e02b0d 100644
--- a/lib/compiler/implementation/scanner/array_based_scanner.dart
+++ b/lib/compiler/implementation/scanner/array_based_scanner.dart
@@ -31,7 +31,7 @@
 
   int select(int choice, PrecedenceInfo yes, PrecedenceInfo no) {
     int next = advance();
-    if (next === choice) {
+    if (identical(next, choice)) {
       appendPrecedenceToken(yes);
       return advance();
     } else {
@@ -54,7 +54,7 @@
     String syntax = keyword.syntax;
 
     // Type parameters and arguments cannot contain 'this' or 'super'.
-    if (syntax === 'this' || syntax === 'super') discardOpenLt();
+    if (identical(syntax, 'this') || identical(syntax, 'super')) discardOpenLt();
     tail.next = new KeywordToken(keyword, tokenStart);
     tail = tail.next;
   }
@@ -96,21 +96,21 @@
     Token token = new BeginGroupToken(info, value, tokenStart);
     tail.next = token;
     tail = tail.next;
-    if (info.kind !== LT_TOKEN) discardOpenLt();
+    if (!identical(info.kind, LT_TOKEN)) discardOpenLt();
     groupingStack = groupingStack.prepend(token);
   }
 
   int appendEndGroup(PrecedenceInfo info, String value, int openKind) {
-    assert(openKind !== LT_TOKEN);
+    assert(!identical(openKind, LT_TOKEN));
     appendStringToken(info, value);
     discardOpenLt();
     if (groupingStack.isEmpty()) {
       return advance();
     }
     BeginGroupToken begin = groupingStack.head;
-    if (begin.kind !== openKind) {
-      if (openKind !== OPEN_CURLY_BRACKET_TOKEN ||
-          begin.kind !== STRING_INTERPOLATION_TOKEN) {
+    if (!identical(begin.kind, openKind)) {
+      if (!identical(openKind, OPEN_CURLY_BRACKET_TOKEN) ||
+          !identical(begin.kind, STRING_INTERPOLATION_TOKEN)) {
         // Not ending string interpolation.
         return error(new SourceString('Unmatched ${begin.stringValue}'));
       }
@@ -129,7 +129,7 @@
   void appendGt(PrecedenceInfo info, String value) {
     appendStringToken(info, value);
     if (groupingStack.isEmpty()) return;
-    if (groupingStack.head.kind === LT_TOKEN) {
+    if (identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack.head.endGroup = tail;
       groupingStack = groupingStack.tail;
     }
@@ -138,11 +138,11 @@
   void appendGtGt(PrecedenceInfo info, String value) {
     appendStringToken(info, value);
     if (groupingStack.isEmpty()) return;
-    if (groupingStack.head.kind === LT_TOKEN) {
+    if (identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack = groupingStack.tail;
     }
     if (groupingStack.isEmpty()) return;
-    if (groupingStack.head.kind === LT_TOKEN) {
+    if (identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack.head.endGroup = tail;
       groupingStack = groupingStack.tail;
     }
@@ -151,15 +151,15 @@
   void appendGtGtGt(PrecedenceInfo info, String value) {
     appendStringToken(info, value);
     if (groupingStack.isEmpty()) return;
-    if (groupingStack.head.kind === LT_TOKEN) {
+    if (identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack = groupingStack.tail;
     }
     if (groupingStack.isEmpty()) return;
-    if (groupingStack.head.kind === LT_TOKEN) {
+    if (identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack = groupingStack.tail;
     }
     if (groupingStack.isEmpty()) return;
-    if (groupingStack.head.kind === LT_TOKEN) {
+    if (identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack.head.endGroup = tail;
       groupingStack = groupingStack.tail;
     }
@@ -172,7 +172,8 @@
   }
 
   void discardOpenLt() {
-    while (!groupingStack.isEmpty() && groupingStack.head.kind === LT_TOKEN) {
+    while (!groupingStack.isEmpty()
+        && identical(groupingStack.head.kind, LT_TOKEN)) {
       groupingStack = groupingStack.tail;
     }
   }
diff --git a/lib/compiler/implementation/scanner/byte_strings.dart b/lib/compiler/implementation/scanner/byte_strings.dart
index 79d3c8d..9f3c454 100644
--- a/lib/compiler/implementation/scanner/byte_strings.dart
+++ b/lib/compiler/implementation/scanner/byte_strings.dart
@@ -27,7 +27,7 @@
   Iterator<int> iterator() => new Utf8Decoder(bytes, offset, length);
 
   int hashCode() {
-    if (_hashCode === null) {
+    if (_hashCode == null) {
       _hashCode = computeHashCode();
     }
     return _hashCode;
@@ -47,7 +47,7 @@
   }
 
   bool isEmpty() => length == 0;
-  bool isPrivate() => !isEmpty() && bytes[offset] === $_;
+  bool isPrivate() => !isEmpty() && identical(bytes[offset], $_);
 
   String get stringValue => null;
 }
diff --git a/lib/compiler/implementation/scanner/class_element_parser.dart b/lib/compiler/implementation/scanner/class_element_parser.dart
index cd1ae54..0e536d9 100644
--- a/lib/compiler/implementation/scanner/class_element_parser.dart
+++ b/lib/compiler/implementation/scanner/class_element_parser.dart
@@ -39,7 +39,7 @@
         MemberListener listener = new MemberListener(compiler, this);
         Parser parser = new ClassElementParser(listener);
         Token token = parser.parseTopLevelDeclaration(beginToken);
-        assert(token === endToken.next);
+        assert(identical(token, endToken.next));
         cachedNode = listener.popNode();
         assert(listener.nodes.isEmpty());
       });
@@ -60,7 +60,7 @@
   Modifiers get modifiers =>
       cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
 
-  bool isInterface() => beginToken.stringValue === "interface";
+  bool isInterface() => identical(beginToken.stringValue, "interface");
 }
 
 class MemberListener extends NodeListener {
@@ -72,12 +72,12 @@
         super(listener, enclosingElement.getCompilationUnit());
 
   bool isConstructorName(Node nameNode) {
-    if (enclosingElement === null ||
+    if (enclosingElement == null ||
         enclosingElement.kind != ElementKind.CLASS) {
       return false;
     }
     SourceString name;
-    if (nameNode.asIdentifier() !== null) {
+    if (nameNode.asIdentifier() != null) {
       name = nameNode.asIdentifier().source;
     } else {
       Send send = nameNode.asSend();
@@ -88,15 +88,15 @@
 
   SourceString getMethodNameHack(Node methodName) {
     Send send = methodName.asSend();
-    if (send === null) return methodName.asIdentifier().source;
+    if (send == null) return methodName.asIdentifier().source;
     Identifier receiver = send.receiver.asIdentifier();
     Identifier selector = send.selector.asIdentifier();
     Operator operator = selector.asOperator();
-    if (operator !== null) {
-      assert(receiver.source.stringValue === 'operator');
+    if (operator != null) {
+      assert(identical(receiver.source.stringValue, 'operator'));
       // TODO(ahe): It is a hack to compare to ')', but it beats
       // parsing the node.
-      bool isUnary = operator.token.next.next.stringValue === ')';
+      bool isUnary = identical(operator.token.next.next.stringValue, ')');
       return Elements.constructOperatorName(operator.source, isUnary);
     } else {
       if (receiver == null) {
@@ -116,12 +116,12 @@
     SourceString name = getMethodNameHack(method.name);
     ElementKind kind = ElementKind.FUNCTION;
     if (isConstructor) {
-      if (getOrSet !== null) {
+      if (getOrSet != null) {
         recoverableError('illegal modifier', token: getOrSet);
       }
       kind = ElementKind.GENERATIVE_CONSTRUCTOR;
-    } else if (getOrSet !== null) {
-      kind = (getOrSet.stringValue === 'get')
+    } else if (getOrSet != null) {
+      kind = (identical(getOrSet.stringValue, 'get'))
              ? ElementKind.GETTER : ElementKind.SETTER;
     }
     Element memberElement =
@@ -149,8 +149,8 @@
     Modifiers modifiers = variableDefinitions.modifiers;
     pushNode(null);
     void buildFieldElement(SourceString name, Element fields) {
-      Element element = new VariableElement(
-          name, fields, ElementKind.FIELD, enclosingElement);
+      Element element =
+          new VariableElement(name, fields, ElementKind.FIELD, null);
       addMember(element);
     }
     buildFieldElements(modifiers, variableDefinitions.definitions,
diff --git a/lib/compiler/implementation/scanner/keyword.dart b/lib/compiler/implementation/scanner/keyword.dart
index 31a4614..768dedf 100644
--- a/lib/compiler/implementation/scanner/keyword.dart
+++ b/lib/compiler/implementation/scanner/keyword.dart
@@ -75,16 +75,16 @@
 
   static Map<String, Keyword> _keywords;
   static Map<String, Keyword> get keywords {
-    if (_keywords === null) {
+    if (_keywords == null) {
       _keywords = computeKeywordMap();
     }
     return _keywords;
   }
 
   const Keyword(String this.syntax,
-                [bool this.isPseudo = false,
-                 bool this.isBuiltIn = false,
-                 PrecedenceInfo this.info = KEYWORD_INFO]);
+                {bool this.isPseudo: false,
+                 bool this.isBuiltIn: false,
+                 PrecedenceInfo this.info: KEYWORD_INFO});
 
   static Map<String, Keyword> computeKeywordMap() {
     Map<String, Keyword> result = new LinkedHashMap<String, Keyword>();
@@ -129,7 +129,7 @@
 
   static KeywordState _KEYWORD_STATE;
   static KeywordState get KEYWORD_STATE {
-    if (_KEYWORD_STATE === null) {
+    if (_KEYWORD_STATE == null) {
       List<String> strings = new List<String>(Keyword.values.length);
       for (int i = 0; i < Keyword.values.length; i++) {
         strings[i] = Keyword.values[i].syntax;
@@ -155,7 +155,7 @@
         int c = strings[i].charCodeAt(start);
         if (chunk != c) {
           if (chunkStart != -1) {
-            assert(result[chunk - $a] === null);
+            assert(result[chunk - $a] == null);
             result[chunk - $a] = computeKeywordStateTable(start + 1, strings,
                                                           chunkStart,
                                                           i - chunkStart);
@@ -166,7 +166,7 @@
       }
     }
     if (chunkStart != -1) {
-      assert(result[chunk - $a] === null);
+      assert(result[chunk - $a] == null);
       result[chunk - $a] =
         computeKeywordStateTable(start + 1, strings, chunkStart,
                                  offset + length - chunkStart);
@@ -190,7 +190,7 @@
   final Keyword keyword;
 
   ArrayKeywordState(List<KeywordState> this.table, String syntax)
-    : keyword = (syntax === null) ? null : Keyword.keywords[syntax];
+    : keyword = (syntax == null) ? null : Keyword.keywords[syntax];
 
   bool isLeaf() => false;
 
@@ -199,7 +199,7 @@
   String toString() {
     StringBuffer sb = new StringBuffer();
     sb.add("[");
-    if (keyword !== null) {
+    if (keyword != null) {
       sb.add("*");
       sb.add(keyword);
       sb.add(" ");
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index a989ef4..2a0572d 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -59,6 +59,13 @@
   void endCompilationUnit(int count, Token token) {
   }
 
+  void beginConstructorReference(Token start) {
+  }
+
+  void endConstructorReference(Token start, Token periodBeforeName,
+                               Token endToken) {
+  }
+
   void beginDoWhileStatement(Token token) {
   }
 
@@ -268,12 +275,6 @@
   void endPartOf(Token partKeyword, Token semicolon) {
   }
 
-  void beginQualifiedList(Token start) {
-  }
-
-  void endQualifiedList(int count) {
-  }
-
   void beginRedirectingFactoryBody(Token token) {
   }
 
@@ -579,14 +580,14 @@
   }
 
   skipToEof(Token token) {
-    while (token.info !== EOF_INFO) {
+    while (!identical(token.info, EOF_INFO)) {
       token = token.next;
     }
     return token;
   }
 
-  void recoverableError(String message, [Token token, Node node]) {
-    if (token === null && node !== null) {
+  void recoverableError(String message, {Token token, Node node}) {
+    if (token == null && node != null) {
       token = node.getBeginToken();
     }
     error(message, token);
@@ -665,7 +666,7 @@
   void endImport(Token importKeyword, Token asKeyword, Token semicolon) {
     NodeList combinators = popNode();
     Identifier prefix;
-    if (asKeyword !== null) {
+    if (asKeyword != null) {
       prefix = popNode();
     }
     LiteralString uri = popLiteralString();
@@ -806,11 +807,11 @@
     TypeAnnotation type = popNode();
     Modifiers modifiers = popNode();
     ElementKind kind;
-    if (getOrSet === null) {
+    if (getOrSet == null) {
       kind = ElementKind.FUNCTION;
-    } else if (getOrSet.stringValue === 'get') {
+    } else if (identical(getOrSet.stringValue, 'get')) {
       kind = ElementKind.GETTER;
-    } else if (getOrSet.stringValue === 'set') {
+    } else if (identical(getOrSet.stringValue, 'set')) {
       kind = ElementKind.SETTER;
     }
     pushElement(new PartialFunctionElement(name.source, beginToken, getOrSet,
@@ -820,8 +821,7 @@
 
   void endTopLevelFields(int count, Token beginToken, Token endToken) {
     void buildFieldElement(SourceString name, Element fields) {
-      pushElement(new VariableElement(
-          name, fields, ElementKind.FIELD, compilationUnitElement));
+      pushElement(new VariableElement(name, fields, ElementKind.FIELD, null));
     }
     NodeList variables = makeNodeList(count, null, null, ",");
     TypeAnnotation type = popNode();
@@ -846,7 +846,7 @@
          variableNodes = variableNodes.tail) {
       Expression initializedIdentifier = variableNodes.head;
       Identifier identifier = initializedIdentifier.asIdentifier();
-      if (identifier === null) {
+      if (identifier == null) {
         identifier = initializedIdentifier.asSendSet().selector.asIdentifier();
       }
       SourceString name = identifier.source;
@@ -946,7 +946,7 @@
   }
 
   Token expectedBlockToSkip(Token token) {
-    if (token.stringValue === 'native') {
+    if (identical(token.stringValue, 'native')) {
       return native.handleNativeBlockToSkip(this, token);
     } else {
       return unexpected(token);
@@ -967,7 +967,7 @@
   }
 
   Token expectedClassBodyToSkip(Token token) {
-    if (token.stringValue === 'native') {
+    if (identical(token.stringValue, 'native')) {
       return native.handleNativeClassBodyToSkip(this, token);
     } else {
       return unexpected(token);
@@ -985,7 +985,7 @@
     return skipToEof(token);
   }
 
-  void recoverableError(String message, [Token token, Node node]) {
+  void recoverableError(String message, {Token token, Node node}) {
     listener.cancel(message, token: token, node: node);
   }
 
@@ -1046,7 +1046,7 @@
       poppedNodes = poppedNodes.prepend(popNode());
     }
     SourceString sourceDelimiter =
-        (delimiter === null) ? null : new SourceString(delimiter);
+        (delimiter == null) ? null : new SourceString(delimiter);
     return new NodeList(beginToken, poppedNodes, endToken, sourceDelimiter);
   }
 
@@ -1188,11 +1188,11 @@
     Identifier name = popNode();
     Modifiers modifiers = popNode();
     ElementKind kind;
-    if (getOrSet === null) {
+    if (getOrSet == null) {
       kind = ElementKind.FUNCTION;
-    } else if (getOrSet.stringValue === 'get') {
+    } else if (identical(getOrSet.stringValue, 'get')) {
       kind = ElementKind.GETTER;
-    } else if (getOrSet.stringValue === 'set') {
+    } else if (identical(getOrSet.stringValue, 'set')) {
       kind = ElementKind.SETTER;
     }
     pushElement(new PartialFunctionElement(name.source, beginToken, getOrSet,
@@ -1202,9 +1202,9 @@
 
   void endFormalParameter(Token token, Token thisKeyword) {
     Expression name = popNode();
-    if (thisKeyword !== null) {
+    if (thisKeyword != null) {
       Identifier thisIdentifier = new Identifier(thisKeyword);
-      if (name.asSend() === null) {
+      if (name.asSend() == null) {
         name = new Send(thisIdentifier, name);
       } else {
         name = name.asSend().copyWithReceiver(thisIdentifier);
@@ -1232,14 +1232,40 @@
     pushNode(null);
   }
 
-  void endQualifiedList(int count) {
-    pushNode(makeNodeList(count, null, null, "."));
+  void endConstructorReference(Token start, Token periodBeforeName,
+                               Token endToken) {
+    Identifier name = null;
+    if (periodBeforeName != null) {
+      name = popNode();
+    }
+    NodeList typeArguments = popNode();
+    Node classReference = popNode();
+    if (typeArguments != null) {
+      classReference = new TypeAnnotation(classReference, typeArguments);
+    } else {
+      Identifier identifier = classReference.asIdentifier();
+      Send send = classReference.asSend();
+      if (identifier != null) {
+        // TODO(ahe): Should be:
+        // classReference = new Send(null, identifier);
+        classReference = identifier;
+      } else if (send != null) {
+        classReference = send;
+      } else {
+        internalError(node: classReference);
+      }
+    }
+    Node constructor = classReference;
+    if (name != null) {
+      // Either typeName<args>.name or x.y.name.
+      constructor = new Send(classReference, name);
+    }
+    pushNode(constructor);
   }
 
   void endRedirectingFactoryBody(Token beginToken,
                                  Token endToken) {
-    NodeList qualifiedList = popNode();
-    pushNode(new Return(beginToken, endToken, qualifiedList));
+    pushNode(new Return(beginToken, endToken, popNode()));
   }
 
   void endReturnStatement(bool hasExpression,
@@ -1258,7 +1284,7 @@
   }
 
   Token expectedFunctionBody(Token token) {
-    if (token.stringValue === 'native') {
+    if (identical(token.stringValue, 'native')) {
       return native.handleNativeFunctionBody(this, token);
     } else {
       listener.cancel(
@@ -1269,7 +1295,7 @@
   }
 
   Token expectedClassBody(Token token) {
-    if (token.stringValue === 'native') {
+    if (identical(token.stringValue, 'native')) {
       return native.handleNativeClassBody(this, token);
     } else {
       listener.cancel(
@@ -1299,9 +1325,9 @@
     Node argument = popNode();
     Node receiver = popNode();
     String tokenString = token.stringValue;
-    if (tokenString === '.' || tokenString === '..') {
+    if (identical(tokenString, '.') || identical(tokenString, '..')) {
       if (argument is !Send) internalError(node: argument);
-      if (argument.asSend().receiver !== null) internalError(node: argument);
+      if (argument.asSend().receiver != null) internalError(node: argument);
       if (argument is SendSet) internalError(node: argument);
       pushNode(argument.asSend().copyWithReceiver(receiver));
     } else {
@@ -1329,9 +1355,9 @@
     Node arg = popNode();
     Node node = popNode();
     Send send = node.asSend();
-    if (send === null) internalError(node: node);
+    if (send == null) internalError(node: node);
     if (!(send.isPropertyAccess || send.isIndex)) internalError(node: send);
-    if (send.asSendSet() !== null) internalError(node: send);
+    if (send.asSendSet() != null) internalError(node: send);
     NodeList arguments;
     if (send.isIndex) {
       Link<Node> link = const Link<Node>().prepend(arg);
@@ -1401,7 +1427,7 @@
   }
 
   void endIfStatement(Token ifToken, Token elseToken) {
-    Statement elsePart = (elseToken === null) ? null : popNode();
+    Statement elsePart = (elseToken == null) ? null : popNode();
     Statement thenPart = popNode();
     ParenthesizedExpression condition = popNode();
     pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken));
@@ -1461,9 +1487,9 @@
   void handleUnaryAssignmentExpression(Token token, bool isPrefix) {
     Node node = popNode();
     Send send = node.asSend();
-    if (send === null) internalError(node: node);
+    if (send == null) internalError(node: node);
     if (!(send.isPropertyAccess || send.isIndex)) internalError(node: send);
-    if (send.asSendSet() !== null) internalError(node: send);
+    if (send.asSendSet() != null) internalError(node: send);
     Node argument = null;
     if (send.isIndex) argument = send.arguments.head;
     Operator op = new Operator(token);
@@ -1519,7 +1545,7 @@
   void endLiteralMapEntry(Token colon, Token endToken) {
     Expression value = popNode();
     Expression key = popNode();
-    if (key.asStringNode() === null) {
+    if (key.asStringNode() == null) {
       recoverableError('expected a string', node: key);
     }
     pushNode(new LiteralMapEntry(key, colon, value));
@@ -1591,7 +1617,7 @@
 
   void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) {
     Block finallyBlock = null;
-    if (finallyKeyword !== null) {
+    if (finallyKeyword != null) {
       finallyBlock = popNode();
     }
     NodeList catchBlocks = makeNodeList(catchCount, null, null, null);
@@ -1606,8 +1632,8 @@
 
   void handleCatchBlock(Token onKeyword, Token catchKeyword) {
     Block block = popNode();
-    NodeList formals = catchKeyword !== null? popNode(): null;
-    TypeAnnotation type = onKeyword !== null ? popNode() : null;
+    NodeList formals = catchKeyword != null? popNode(): null;
+    TypeAnnotation type = onKeyword != null ? popNode() : null;
     pushNode(new CatchBlock(type, formals, block, onKeyword, catchKeyword));
   }
 
@@ -1666,7 +1692,7 @@
     // TODO(karlklose): don't throw type parameters away.
     NodeList typeParameters;
     Node name;
-    if (periodBeforeName !== null) {
+    if (periodBeforeName != null) {
       name = popNode();
       typeParameters = popNode();
       // A library prefix was handled in [handleQualified].
@@ -1749,7 +1775,8 @@
     listener.log(message);
   }
 
-  void internalError([Token token, Node node]) {
+  void internalError({Token token, Node node}) {
+    // TODO(ahe): This should call listener.internalError.
     listener.cancel('internal error', token: token, node: node);
     throw 'internal error';
   }
@@ -1771,7 +1798,7 @@
 
   FunctionExpression parseNode(DiagnosticListener listener) {
     if (cachedNode != null) return cachedNode;
-    if (patch === null) {
+    if (patch == null) {
       if (modifiers.isExternal()) {
         listener.cancel("External method without an implementation",
                         element: this);
@@ -1794,7 +1821,7 @@
 
   PartialFunctionElement cloneTo(Element enclosing,
                                  DiagnosticListener listener) {
-    if (patch !== null) {
+    if (patch != null) {
       listener.cancel("Cloning a patched function.", element: this);
     }
     PartialFunctionElement result = new PartialFunctionElement(
@@ -1821,10 +1848,10 @@
     if (!cachedNode.modifiers.isVar() &&
         !cachedNode.modifiers.isFinal() &&
         !cachedNode.modifiers.isConst() &&
-        cachedNode.type === null) {
+        cachedNode.type == null) {
       listener.cancel('A field declaration must start with var, final, '
                       'const, or a type annotation.',
-                      cachedNode);
+                      node: cachedNode);
     }
     return cachedNode;
   }
@@ -1846,7 +1873,7 @@
       : super(name, enclosing);
 
   Node parseNode(DiagnosticListener listener) {
-    if (cachedNode !== null) return cachedNode;
+    if (cachedNode != null) return cachedNode;
     cachedNode = parse(listener,
                        getCompilationUnit(),
                        (p) => p.parseTopLevelDeclaration(token));
@@ -1872,7 +1899,7 @@
   PartialMetadataAnnotation(this.beginToken);
 
   Node parseNode(DiagnosticListener listener) {
-    if (cachedNode !== null) return cachedNode;
+    if (cachedNode != null) return cachedNode;
     cachedNode = parse(listener,
                        annotatedElement.getCompilationUnit(),
                        (p) => p.parseSend(beginToken.next));
diff --git a/lib/compiler/implementation/scanner/parser.dart b/lib/compiler/implementation/scanner/parser.dart
index 54ebdd5..a7f9fcd 100644
--- a/lib/compiler/implementation/scanner/parser.dart
+++ b/lib/compiler/implementation/scanner/parser.dart
@@ -34,7 +34,7 @@
   Token parseUnit(Token token) {
     listener.beginCompilationUnit(token);
     int count = 0;
-    while (token.kind !== EOF_TOKEN) {
+    while (!identical(token.kind, EOF_TOKEN)) {
       token = parseTopLevelDeclaration(token);
       count++;
     }
@@ -45,21 +45,21 @@
   Token parseTopLevelDeclaration(Token token) {
     token = parseMetadataStar(token);
     final String value = token.stringValue;
-    if (value === 'interface') {
+    if (identical(value, 'interface')) {
       return parseInterface(token);
-    } else if ((value === 'abstract') || (value === 'class')) {
+    } else if ((identical(value, 'abstract')) || (identical(value, 'class'))) {
       return parseClass(token);
-    } else if (value === 'typedef') {
+    } else if (identical(value, 'typedef')) {
       return parseNamedFunctionAlias(token);
-    } else if (value === '#') {
+    } else if (identical(value, '#')) {
       return parseScriptTags(token);
-    } else if (value === 'library') {
+    } else if (identical(value, 'library')) {
       return parseLibraryName(token);
-    } else if (value === 'import') {
+    } else if (identical(value, 'import')) {
       return parseImport(token);
-    } else if (value === 'export') {
+    } else if (identical(value, 'export')) {
       return parseExport(token);
-    } else if (value === 'part') {
+    } else if (identical(value, 'part')) {
       return parsePartOrPartOf(token);
     } else {
       return parseTopLevelMember(token);
@@ -114,9 +114,9 @@
     int count = 0;
     while (true) {
       String value = token.stringValue;
-      if ('hide' === value) {
+      if (identical('hide', value)) {
         token = parseHide(token);
-      } else if ('show' === value) {
+      } else if (identical('show', value)) {
         token = parseShow(token);
       } else {
         listener.endCombinators(count);
@@ -251,7 +251,7 @@
   }
 
   Token parseReturnTypeOpt(Token token) {
-    if (token.stringValue === 'void') {
+    if (identical(token.stringValue, 'void')) {
       listener.handleVoidKeyword(token);
       return token.next;
     } else {
@@ -281,10 +281,10 @@
       ++parameterCount;
       token = token.next;
       String value = token.stringValue;
-      if (value === '[') {
+      if (identical(value, '[')) {
         token = parseOptionalFormalParameters(token, false);
         break;
-      } else if (value === '{') {
+      } else if (identical(value, '{')) {
         token = parseOptionalFormalParameters(token, true);
         break;
       }
@@ -312,7 +312,7 @@
       listener.handleFunctionTypedFormalParameter(token);
     }
     String value = token.stringValue;
-    if (('=' === value) || (':' === value)) {
+    if ((identical('=', value)) || (identical(':', value))) {
       // TODO(ahe): Validate that these are only used for optional parameters.
       Token equal = token;
       token = parseExpression(token.next);
@@ -342,7 +342,7 @@
 
   Token parseTypeOpt(Token token) {
     String value = token.stringValue;
-    if (value !== 'this') {
+    if (!identical(value, 'this')) {
       Token peek = peekAfterExpectedType(token);
       if (peek.isIdentifier() || optional('this', peek)) {
         return parseType(token);
@@ -354,15 +354,15 @@
 
   bool isValidTypeReference(Token token) {
     final kind = token.kind;
-    if (kind === IDENTIFIER_TOKEN) return true;
-    if (kind === KEYWORD_TOKEN) {
+    if (identical(kind, IDENTIFIER_TOKEN)) return true;
+    if (identical(kind, KEYWORD_TOKEN)) {
       Keyword keyword = token.value;
       String value = keyword.stringValue;
       // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support.
       return keyword.isPseudo
-          || (value === 'dynamic')
-          || (value === 'Dynamic')
-          || (value === 'void');
+          || (identical(value, 'dynamic'))
+          || (identical(value, 'Dynamic'))
+          || (identical(value, 'void'));
     }
     return false;
   }
@@ -408,8 +408,8 @@
 
   bool isDefaultKeyword(Token token) {
     String value = token.stringValue;
-    if (value === 'default') return true;
-    if (value === 'factory') {
+    if (identical(value, 'default')) return true;
+    if (identical(value, 'factory')) {
       listener.recoverableError("expected 'default'", token: token);
       return true;
     }
@@ -422,9 +422,9 @@
     }
     BeginGroupToken beginGroupToken = token;
     Token endGroup = beginGroupToken.endGroup;
-    if (endGroup === null) {
+    if (endGroup == null) {
       return listener.unmatched(beginGroupToken);
-    } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) {
+    } else if (!identical(endGroup.kind, $CLOSE_CURLY_BRACKET)) {
       return listener.unmatched(beginGroupToken);
     }
     return beginGroupToken.endGroup;
@@ -466,7 +466,7 @@
   }
 
   Token parseStringPart(Token token) {
-    if (token.kind === STRING_TOKEN) {
+    if (identical(token.kind, STRING_TOKEN)) {
       listener.handleStringPart(token);
       return token.next;
     } else {
@@ -484,7 +484,7 @@
   }
 
   Token expect(String string, Token token) {
-    if (string !== token.stringValue) {
+    if (!identical(string, token.stringValue)) {
       return listener.expected(string, token);
     }
     return token.next;
@@ -505,10 +505,10 @@
   /**
    * Returns true if the stringValue of the [token] is [value].
    */
-  bool optional(String value, Token token) => value === token.stringValue;
+  bool optional(String value, Token token) => identical(value, token.stringValue);
 
   bool notEofOrValue(String value, Token token) {
-    return token.kind !== EOF_TOKEN && value !== token.stringValue;
+    return !identical(token.kind, EOF_TOKEN) && !identical(value, token.stringValue);
   }
 
   Token parseType(Token token) {
@@ -552,11 +552,11 @@
         ++count;
       } while (optional(',', token));
       Token next = token.next;
-      if (token.stringValue === '>>') {
+      if (identical(token.stringValue, '>>')) {
         token = new Token(GT_INFO, token.charOffset);
         token.next = new Token(GT_INFO, token.charOffset + 1);
         token.next.next = next;
-      } else if (token.stringValue === '>>>') {
+      } else if (identical(token.stringValue, '>>>')) {
         token = new Token(GT_INFO, token.charOffset);
         token.next = new Token(GT_GT_INFO, token.charOffset + 1);
         token.next.next = next;
@@ -581,7 +581,7 @@
     Token getOrSet;
     if (!identifiers.isEmpty()) {
       String value = identifiers.head.stringValue;
-      if ((value === 'get') || (value === 'set')) {
+      if ((identical(value, 'get')) || (identical(value, 'set'))) {
         getOrSet = identifiers.head;
         identifiers = identifiers.tail;
       }
@@ -594,7 +594,7 @@
       }
     }
     parseModifierList(identifiers.reverse());
-    if (type === null) {
+    if (type == null) {
       listener.handleNoType(token);
     } else {
       parseReturnTypeOpt(type);
@@ -606,17 +606,18 @@
       // Loop to allow the listener to rewrite the token stream for
       // error handling.
       final String value = token.stringValue;
-      if ((value === '(') || (value === '{') || (value === '=>')) {
+      if ((identical(value, '(')) || (identical(value, '{'))
+          || (identical(value, '=>'))) {
         isField = false;
         break;
-      } else if ((value === '=') || (value === ',')) {
+      } else if ((identical(value, '=')) || (identical(value, ','))) {
         isField = true;
         break;
-      } else if (value === ';') {
+      } else if (identical(value, ';')) {
         if (getOrSet != null) {
           // If we found a "get" keyword, this must be an abstract
           // getter.
-          isField = (getOrSet.stringValue !== 'get');
+          isField = (!identical(getOrSet.stringValue, 'get'));
           // TODO(ahe): This feels like a hack.
         } else {
           isField = true;
@@ -624,7 +625,7 @@
         break;
       } else {
         token = listener.unexpected(token);
-        if (token.kind === EOF_TOKEN) {
+        if (identical(token.kind, EOF_TOKEN)) {
           // TODO(ahe): This is a hack. It would be better to tell the
           // listener more explicitly that it must pop an identifier.
           listener.endTopLevelFields(1, start, token);
@@ -653,12 +654,14 @@
   Link<Token> findMemberName(Token token) {
     Token start = token;
     Link<Token> identifiers = const Link<Token>();
-    while (token.kind !== EOF_TOKEN) {
+    while (!identical(token.kind, EOF_TOKEN)) {
       String value = token.stringValue;
-      if ((value === '(') || (value === '{') || (value === '=>')) {
+      if ((identical(value, '(')) || (identical(value, '{'))
+          || (identical(value, '=>'))) {
         // A method.
         return identifiers;
-      } else if ((value === '=') || (value === ';') || (value === ',')) {
+      } else if ((identical(value, '=')) || (identical(value, ';'))
+          || (identical(value, ','))) {
         // A field or abstract getter.
         return identifiers;
       }
@@ -738,7 +741,7 @@
   }
 
   Token parseLiteralStringOrRecoverExpression(Token token) {
-    if (token.kind === STRING_TOKEN) {
+    if (identical(token.kind, STRING_TOKEN)) {
       return parseLiteralString(token);
     } else {
       listener.recoverableError("unexpected", token: token);
@@ -752,12 +755,12 @@
 
   bool isModifier(Token token) {
     final String value = token.stringValue;
-    return ('final' === value) ||
-           ('var' === value) ||
-           ('const' === value) ||
-           ('abstract' === value) ||
-           ('static' === value) ||
-           ('external' === value);
+    return (identical('final', value)) ||
+           (identical('var', value)) ||
+           (identical('const', value)) ||
+           (identical('abstract', value)) ||
+           (identical('static', value)) ||
+           (identical('external', value));
   }
 
   Token parseModifier(Token token) {
@@ -782,7 +785,7 @@
 
   Token parseModifiers(Token token) {
     int count = 0;
-    while (token.kind === KEYWORD_TOKEN) {
+    while (identical(token.kind, KEYWORD_TOKEN)) {
       if (!isModifier(token))
         break;
       token = parseModifier(token);
@@ -796,19 +799,19 @@
     // TODO(ahe): Also handle var?
     // We are looking at "identifier ...".
     Token peek = token.next;
-    if (peek.kind === PERIOD_TOKEN) {
+    if (identical(peek.kind, PERIOD_TOKEN)) {
       if (peek.next.isIdentifier()) {
         // Look past a library prefix.
         peek = peek.next.next;
       }
     }
     // We are looking at "qualified ...".
-    if (peek.kind === LT_TOKEN) {
+    if (identical(peek.kind, LT_TOKEN)) {
       // Possibly generic type.
       // We are looking at "qualified '<'".
       BeginGroupToken beginGroupToken = peek;
       Token gtToken = beginGroupToken.endGroup;
-      if (gtToken !== null) {
+      if (gtToken != null) {
         // We are looking at "qualified '<' ... '>' ...".
         return gtToken.next;
       }
@@ -821,7 +824,7 @@
    * If [token] is not the start of a type, [Listener.unexpectedType] is called.
    */
   Token peekAfterExpectedType(Token token) {
-    if ('void' !== token.stringValue && !token.isIdentifier()) {
+    if (!identical('void', token.stringValue) && !token.isIdentifier()) {
       return listener.expectedType(token);
     }
     return peekAfterType(token);
@@ -845,7 +848,7 @@
 
   bool isGetOrSet(Token token) {
     final String value = token.stringValue;
-    return (value === 'get') || (value === 'set');
+    return (identical(value, 'get')) || (identical(value, 'set'));
   }
 
   bool isFactoryDeclaration(Token token) {
@@ -890,7 +893,7 @@
       }
     }
     parseModifierList(identifiers.reverse());
-    if (type === null) {
+    if (type == null) {
       listener.handleNoType(token);
     } else {
       parseReturnTypeOpt(type);
@@ -906,26 +909,26 @@
       // Loop to allow the listener to rewrite the token stream for
       // error handling.
       final String value = token.stringValue;
-      if ((value === '(') || (value === '.') || (value === '{') ||
-          (value === '=>')) {
+      if ((identical(value, '(')) || (identical(value, '.'))
+          || (identical(value, '{')) || (identical(value, '=>'))) {
         isField = false;
         break;
-      } else if (value === ';') {
+      } else if (identical(value, ';')) {
         if (getOrSet != null) {
           // If we found a "get" keyword, this must be an abstract
           // getter.
-          isField = (getOrSet.stringValue !== 'get');
+          isField = (!identical(getOrSet.stringValue, 'get'));
           // TODO(ahe): This feels like a hack.
         } else {
           isField = true;
         }
         break;
-      } else if ((value === '=') || (value === ',')) {
+      } else if ((identical(value, '=')) || (identical(value, ','))) {
         isField = true;
         break;
       } else {
         token = listener.unexpected(token);
-        if (token.kind === EOF_TOKEN) {
+        if (identical(token.kind, EOF_TOKEN)) {
           // TODO(ahe): This is a hack, see parseTopLevelMember.
           listener.endFields(1, start, token);
           return token;
@@ -935,7 +938,7 @@
     if (isField) {
       int fieldCount = 1;
       token = parseVariableInitializerOpt(token);
-      if (getOrSet !== null) {
+      if (getOrSet != null) {
         listener.recoverableError("unexpected", token: getOrSet);
       }
       while (optional(',', token)) {
@@ -950,7 +953,11 @@
       token = parseQualifiedRestOpt(token);
       token = parseFormalParametersOpt(token);
       token = parseInitializersOpt(token);
-      token = parseFunctionBody(token, false);
+      if (optional('=', token)) {
+        token = parseRedirectingFactoryBody(token);
+      } else {
+        token = parseFunctionBody(token, false);
+      }
       listener.endMethod(getOrSet, start, token);
     }
     return token.next;
@@ -959,7 +966,7 @@
   Token parseFactoryMethod(Token token) {
     assert(isFactoryDeclaration(token));
     Token start = token;
-    if (token.stringValue === 'external') token = token.next;
+    if (identical(token.stringValue, 'external')) token = token.next;
     Token constKeyword = null;
     if (optional('const', token)) {
       constKeyword = token;
@@ -1001,14 +1008,14 @@
   Token parseFunction(Token token, Token getOrSet) {
     listener.beginFunction(token);
     token = parseModifiers(token);
-    if (getOrSet === token) token = token.next;
+    if (identical(getOrSet, token)) token = token.next;
     if (optional('operator', token)) {
       listener.handleNoType(token);
       listener.beginFunctionName(token);
       token = parseOperatorName(token);
     } else {
       token = parseReturnTypeOpt(token);
-      if (getOrSet === token) token = token.next;
+      if (identical(getOrSet, token)) token = token.next;
       listener.beginFunctionName(token);
       if (optional('operator', token)) {
         token = parseOperatorName(token);
@@ -1020,7 +1027,11 @@
     listener.endFunctionName(token);
     token = parseFormalParametersOpt(token);
     token = parseInitializersOpt(token);
-    token = parseFunctionBody(token, false);
+    if (optional('=', token)) {
+      token = parseRedirectingFactoryBody(token);
+    } else {
+      token = parseFunctionBody(token, false);
+    }
     listener.endFunction(getOrSet, token);
     return token.next;
   }
@@ -1056,23 +1067,18 @@
     return isBlock ? token.next : token;
   }
 
-  Token parseQualifiedList(Token token) {
-    listener.beginQualifiedList(token);
-    Token parseQualifiedPart(Token token) {
-      Token start = token;
-      token = parseIdentifier(token);
-      token = parseTypeVariablesOpt(token);
-      listener.endType(start, null);
-      return token;
+  Token parseConstructorReference(Token token) {
+    Token start = token;
+    listener.beginConstructorReference(start);
+    token = parseIdentifier(token);
+    token = parseQualifiedRestOpt(token);
+    token = parseTypeArgumentsOpt(token);
+    Token period = null;
+    if (optional('.', token)) {
+      period = token;
+      token = parseIdentifier(token.next);
     }
-    Token beginToken = token;
-    token = parseQualifiedPart(token);
-    int count = 1;
-    while (optional('.', token)) {
-      token = parseQualifiedPart(token.next);
-      count++;
-    }
-    listener.endQualifiedList(count);
+    listener.endConstructorReference(start, period, token);
     return token;
   }
 
@@ -1080,7 +1086,7 @@
     listener.beginRedirectingFactoryBody(token);
     assert(optional('=', token));
     Token equals = token;
-    token = parseQualifiedList(token.next);
+    token = parseConstructorReference(token.next);
     Token semicolon = token;
     expectSemicolon(token);
     listener.endRedirectingFactoryBody(equals, semicolon);
@@ -1121,39 +1127,39 @@
 
   Token parseStatement(Token token) {
     final value = token.stringValue;
-    if (token.kind === IDENTIFIER_TOKEN) {
+    if (identical(token.kind, IDENTIFIER_TOKEN)) {
       return parseExpressionStatementOrDeclaration(token);
-    } else if (value === '{') {
+    } else if (identical(value, '{')) {
       return parseBlock(token);
-    } else if (value === 'return') {
+    } else if (identical(value, 'return')) {
       return parseReturnStatement(token);
-    } else if (value === 'var' || value === 'final') {
+    } else if (identical(value, 'var') || identical(value, 'final')) {
       return parseVariablesDeclaration(token);
-    } else if (value === 'if') {
+    } else if (identical(value, 'if')) {
       return parseIfStatement(token);
-    } else if (value === 'for') {
+    } else if (identical(value, 'for')) {
       return parseForStatement(token);
-    } else if (value === 'throw') {
+    } else if (identical(value, 'throw')) {
       return parseThrowStatement(token);
-    } else if (value === 'void') {
+    } else if (identical(value, 'void')) {
       return parseExpressionStatementOrDeclaration(token);
-    } else if (value === 'while') {
+    } else if (identical(value, 'while')) {
       return parseWhileStatement(token);
-    } else if (value === 'do') {
+    } else if (identical(value, 'do')) {
       return parseDoWhileStatement(token);
-    } else if (value === 'try') {
+    } else if (identical(value, 'try')) {
       return parseTryStatement(token);
-    } else if (value === 'switch') {
+    } else if (identical(value, 'switch')) {
       return parseSwitchStatement(token);
-    } else if (value === 'break') {
+    } else if (identical(value, 'break')) {
       return parseBreakStatement(token);
-    } else if (value === 'continue') {
+    } else if (identical(value, 'continue')) {
       return parseContinueStatement(token);
-    } else if (value === 'assert') {
+    } else if (identical(value, 'assert')) {
       return parseAssertStatement(token);
-    } else if (value === ';') {
+    } else if (identical(value, ';')) {
       return parseEmptyStatement(token);
-    } else if (value === 'const') {
+    } else if (identical(value, 'const')) {
       return parseExpressionStatementOrConstDeclaration(token);
     } else if (token.isIdentifier()) {
       return parseExpressionStatementOrDeclaration(token);
@@ -1165,7 +1171,7 @@
   Token parseReturnStatement(Token token) {
     Token begin = token;
     listener.beginReturnStatement(begin);
-    assert('return' === token.stringValue);
+    assert(identical('return', token.stringValue));
     token = token.next;
     if (optional(';', token)) {
       listener.endReturnStatement(false, begin, token);
@@ -1178,7 +1184,7 @@
 
   Token peekIdentifierAfterType(Token token) {
     Token peek = peekAfterType(token);
-    if (peek !== null && peek.isIdentifier()) {
+    if (peek != null && peek.isIdentifier()) {
       // We are looking at "type identifier".
       return peek;
     } else {
@@ -1188,7 +1194,7 @@
 
   Token peekIdentifierAfterOptionalType(Token token) {
     Token peek = peekIdentifierAfterType(token);
-    if (peek !== null) {
+    if (peek != null) {
       // We are looking at "type identifier".
       return peek;
     } else if (token.isIdentifier()) {
@@ -1200,18 +1206,18 @@
   }
 
   Token parseExpressionStatementOrDeclaration(Token token) {
-    assert(token.isIdentifier() || token.stringValue === 'void');
+    assert(token.isIdentifier() || identical(token.stringValue, 'void'));
     Token identifier = peekIdentifierAfterType(token);
-    if (identifier !== null) {
+    if (identifier != null) {
       assert(identifier.isIdentifier());
       Token afterId = identifier.next;
       int afterIdKind = afterId.kind;
-      if (afterIdKind === EQ_TOKEN ||
-          afterIdKind === SEMICOLON_TOKEN ||
-          afterIdKind === COMMA_TOKEN) {
+      if (identical(afterIdKind, EQ_TOKEN) ||
+          identical(afterIdKind, SEMICOLON_TOKEN) ||
+          identical(afterIdKind, COMMA_TOKEN)) {
         // We are looking at "type identifier" followed by '=', ';', ','.
         return parseVariablesDeclaration(token);
-      } else if (afterIdKind === OPEN_PAREN_TOKEN) {
+      } else if (identical(afterIdKind, OPEN_PAREN_TOKEN)) {
         // We are looking at "type identifier '('".
         BeginGroupToken beginParen = afterId;
         Token endParen = beginParen.endGroup;
@@ -1229,7 +1235,7 @@
       } else if (optional('(', token.next)) {
         BeginGroupToken begin = token.next;
         String afterParens = begin.endGroup.next.stringValue;
-        if (afterParens === '{' || afterParens === '=>') {
+        if (identical(afterParens, '{') || identical(afterParens, '=>')) {
           return parseFunctionDeclaration(token);
         }
       }
@@ -1238,18 +1244,18 @@
   }
 
   Token parseExpressionStatementOrConstDeclaration(Token token) {
-    assert(token.stringValue === 'const');
+    assert(identical(token.stringValue, 'const'));
     if (isModifier(token.next)) {
       return parseVariablesDeclaration(token);
     }
     Token identifier = peekIdentifierAfterOptionalType(token.next);
-    if (identifier !== null) {
+    if (identifier != null) {
       assert(identifier.isIdentifier());
       Token afterId = identifier.next;
       int afterIdKind = afterId.kind;
-      if (afterIdKind === EQ_TOKEN ||
-          afterIdKind === SEMICOLON_TOKEN ||
-          afterIdKind === COMMA_TOKEN) {
+      if (identical(afterIdKind, EQ_TOKEN) ||
+          identical(afterIdKind, SEMICOLON_TOKEN) ||
+          identical(afterIdKind, COMMA_TOKEN)) {
         // We are looking at "const type identifier" followed by '=', ';', or
         // ','.
         return parseVariablesDeclaration(token);
@@ -1313,41 +1319,41 @@
     PrecedenceInfo info = token.info;
     int tokenLevel = info.precedence;
     for (int level = tokenLevel; level >= precedence; --level) {
-      while (tokenLevel === level) {
+      while (identical(tokenLevel, level)) {
         Token operator = token;
-        if (tokenLevel === CASCADE_PRECEDENCE) {
+        if (identical(tokenLevel, CASCADE_PRECEDENCE)) {
           if (!allowCascades) {
             return token;
           }
           token = parseCascadeExpression(token);
-        } else if (tokenLevel === ASSIGNMENT_PRECEDENCE) {
+        } else if (identical(tokenLevel, ASSIGNMENT_PRECEDENCE)) {
           // Right associative, so we recurse at the same precedence
           // level.
           token = parsePrecedenceExpression(token.next, level, allowCascades);
           listener.handleAssignmentExpression(operator);
-        } else if (tokenLevel === POSTFIX_PRECEDENCE) {
-          if (info === PERIOD_INFO) {
+        } else if (identical(tokenLevel, POSTFIX_PRECEDENCE)) {
+          if (identical(info, PERIOD_INFO)) {
             // Left associative, so we recurse at the next higher
             // precedence level. However, POSTFIX_PRECEDENCE is the
             // highest level, so we just call parseUnaryExpression
             // directly.
             token = parseUnaryExpression(token.next, allowCascades);
             listener.handleBinaryExpression(operator);
-          } else if ((info === OPEN_PAREN_INFO) ||
-                     (info === OPEN_SQUARE_BRACKET_INFO)) {
+          } else if ((identical(info, OPEN_PAREN_INFO)) ||
+                     (identical(info, OPEN_SQUARE_BRACKET_INFO))) {
             token = parseArgumentOrIndexStar(token);
-          } else if ((info === PLUS_PLUS_INFO) ||
-                     (info === MINUS_MINUS_INFO)) {
+          } else if ((identical(info, PLUS_PLUS_INFO)) ||
+                     (identical(info, MINUS_MINUS_INFO))) {
             listener.handleUnaryPostfixAssignmentExpression(token);
             token = token.next;
           } else {
             token = listener.unexpected(token);
           }
-        } else if (info === IS_INFO) {
+        } else if (identical(info, IS_INFO)) {
           token = parseIsOperatorRest(token);
-        } else if (info === AS_INFO) {
+        } else if (identical(info, AS_INFO)) {
           token = parseAsOperatorRest(token);
-        } else if (info === QUESTION_INFO) {
+        } else if (identical(info, QUESTION_INFO)) {
           token = parseConditionalExpressionRest(token);
         } else {
           // Left associative, so we recurse at the next higher
@@ -1385,9 +1391,9 @@
         listener.handleBinaryExpression(period);
       }
       token = parseArgumentOrIndexStar(token);
-    } while (mark !== token);
+    } while (!identical(mark, token));
 
-    if (token.info.precedence === ASSIGNMENT_PRECEDENCE) {
+    if (identical(token.info.precedence, ASSIGNMENT_PRECEDENCE)) {
       Token assignment = token;
       token = parseExpressionWithoutCascade(token.next);
       listener.handleAssignmentExpression(assignment);
@@ -1399,17 +1405,17 @@
   Token parseUnaryExpression(Token token, bool allowCascades) {
     String value = token.stringValue;
     // Prefix:
-    if (value === '+') {
+    if (identical(value, '+')) {
       // Dart only allows "prefix plus" as an initial part of a
       // decimal literal. We scan it as a separate token and let
       // the parser listener combine it with the digits.
       Token next = token.next;
-      if (next.charOffset === token.charOffset + 1) {
-        if (next.kind === INT_TOKEN) {
+      if (identical(next.charOffset, token.charOffset + 1)) {
+        if (identical(next.kind, INT_TOKEN)) {
           listener.handleLiteralInt(token);
           return next.next;
         }
-        if (next.kind === DOUBLE_TOKEN) {
+        if (identical(next.kind, DOUBLE_TOKEN)) {
           listener.handleLiteralDouble(token);
           return next.next;
         }
@@ -1417,16 +1423,16 @@
       listener.recoverableError("Unexpected token '+'", token: token);
       return parsePrecedenceExpression(next, POSTFIX_PRECEDENCE,
                                        allowCascades);
-    } else if ((value === '!') ||
-               (value === '-') ||
-               (value === '~')) {
+    } else if ((identical(value, '!')) ||
+               (identical(value, '-')) ||
+               (identical(value, '~'))) {
       Token operator = token;
       // Right associative, so we recurse at the same precedence
       // level.
       token = parsePrecedenceExpression(token.next, POSTFIX_PRECEDENCE,
                                         allowCascades);
       listener.handleUnaryPrefixExpression(operator);
-    } else if ((value === '++') || value === '--') {
+    } else if ((identical(value, '++')) || identical(value, '--')) {
       // TODO(ahe): Validate this is used correctly.
       Token operator = token;
       // Right associative, so we recurse at the same precedence
@@ -1462,43 +1468,44 @@
 
   Token parsePrimary(Token token) {
     final kind = token.kind;
-    if (kind === IDENTIFIER_TOKEN) {
+    if (identical(kind, IDENTIFIER_TOKEN)) {
       return parseSendOrFunctionLiteral(token);
-    } else if (kind === INT_TOKEN || kind === HEXADECIMAL_TOKEN) {
+    } else if (identical(kind, INT_TOKEN)
+        || identical(kind, HEXADECIMAL_TOKEN)) {
       return parseLiteralInt(token);
-    } else if (kind === DOUBLE_TOKEN) {
+    } else if (identical(kind, DOUBLE_TOKEN)) {
       return parseLiteralDouble(token);
-    } else if (kind === STRING_TOKEN) {
+    } else if (identical(kind, STRING_TOKEN)) {
       return parseLiteralString(token);
-    } else if (kind === KEYWORD_TOKEN) {
+    } else if (identical(kind, KEYWORD_TOKEN)) {
       final value = token.stringValue;
-      if ((value === 'true') || (value === 'false')) {
+      if ((identical(value, 'true')) || (identical(value, 'false'))) {
         return parseLiteralBool(token);
-      } else if (value === 'null') {
+      } else if (identical(value, 'null')) {
         return parseLiteralNull(token);
-      } else if (value === 'this') {
+      } else if (identical(value, 'this')) {
         return parseThisExpression(token);
-      } else if (value === 'super') {
+      } else if (identical(value, 'super')) {
         return parseSuperExpression(token);
-      } else if (value === 'new') {
+      } else if (identical(value, 'new')) {
         return parseNewExpression(token);
-      } else if (value === 'const') {
+      } else if (identical(value, 'const')) {
         return parseConstExpression(token);
-      } else if (value === 'void') {
+      } else if (identical(value, 'void')) {
         return parseFunctionExpression(token);
       } else if (token.isIdentifier()) {
         return parseSendOrFunctionLiteral(token);
       } else {
         return listener.expectedExpression(token);
       }
-    } else if (kind === OPEN_PAREN_TOKEN) {
+    } else if (identical(kind, OPEN_PAREN_TOKEN)) {
       return parseParenthesizedExpressionOrFunctionLiteral(token);
-    } else if ((kind === LT_TOKEN) ||
-               (kind === OPEN_SQUARE_BRACKET_TOKEN) ||
-               (kind === OPEN_CURLY_BRACKET_TOKEN) ||
-               token.stringValue === '[]') {
+    } else if ((identical(kind, LT_TOKEN)) ||
+               (identical(kind, OPEN_SQUARE_BRACKET_TOKEN)) ||
+               (identical(kind, OPEN_CURLY_BRACKET_TOKEN)) ||
+               identical(token.stringValue, '[]')) {
       return parseLiteralListOrMap(token);
-    } else if (kind === QUESTION_TOKEN) {
+    } else if (identical(kind, QUESTION_TOKEN)) {
       return parseArgumentDefinitionTest(token);
     } else {
       return listener.expectedExpression(token);
@@ -1518,7 +1525,8 @@
     BeginGroupToken beginGroup = token;
     int kind = beginGroup.endGroup.next.kind;
     if (mayParseFunctionExpressions &&
-        (kind === FUNCTION_TOKEN || kind === OPEN_CURLY_BRACKET_TOKEN)) {
+        (identical(kind, FUNCTION_TOKEN)
+            || identical(kind, OPEN_CURLY_BRACKET_TOKEN))) {
       return parseUnamedFunction(token);
     } else {
       bool old = mayParseFunctionExpressions;
@@ -1533,7 +1541,7 @@
     Token begin = token;
     token = expect('(', token);
     token = parseExpression(token);
-    if (begin.endGroup !== token) {
+    if (!identical(begin.endGroup, token)) {
       listener.unexpected(token);
       token = begin.endGroup;
     }
@@ -1622,7 +1630,7 @@
   Token parseSendOrFunctionLiteral(Token token) {
     if (!mayParseFunctionExpressions) return parseSend(token);
     Token peek = peekAfterExpectedType(token);
-    if (peek.kind === IDENTIFIER_TOKEN && isFunctionDeclaration(peek.next)) {
+    if (identical(peek.kind, IDENTIFIER_TOKEN) && isFunctionDeclaration(peek.next)) {
       return parseFunctionExpression(token);
     } else if (isFunctionDeclaration(token.next)) {
       return parseFunctionExpression(token);
@@ -1635,7 +1643,7 @@
     if (optional('(', token)) {
       BeginGroupToken begin = token;
       String afterParens = begin.endGroup.next.stringValue;
-      if (afterParens === '{' || afterParens === '=>') {
+      if (identical(afterParens, '{') || identical(afterParens, '=>')) {
         return true;
       }
     }
@@ -1665,10 +1673,10 @@
     Token constKeyword = token;
     token = expect('const', token);
     final String value = token.stringValue;
-    if ((value === '<') ||
-        (value === '[') ||
-        (value === '[]') ||
-        (value === '{')) {
+    if ((identical(value, '<')) ||
+        (identical(value, '[')) ||
+        (identical(value, '[]')) ||
+        (identical(value, '{'))) {
       return parseLiteralListOrMap(constKeyword);
     }
     token = parseType(token);
@@ -1696,7 +1704,7 @@
   Token parseLiteralString(Token token) {
     token = parseSingleLiteralString(token);
     int count = 1;
-    while (token.kind === STRING_TOKEN) {
+    while (identical(token.kind, STRING_TOKEN)) {
       token = parseSingleLiteralString(token);
       count++;
     }
@@ -1716,12 +1724,12 @@
     int interpolationCount = 0;
     var kind = token.kind;
     while (kind != EOF_TOKEN) {
-      if (kind === STRING_INTERPOLATION_TOKEN) {
+      if (identical(kind, STRING_INTERPOLATION_TOKEN)) {
         // Parsing ${expression}.
         token = token.next;
         token = parseExpression(token);
         token = expect('}', token);
-      } else if (kind === STRING_INTERPOLATION_IDENTIFIER_TOKEN) {
+      } else if (identical(kind, STRING_INTERPOLATION_IDENTIFIER_TOKEN)) {
         // Parsing $identifier.
         token = token.next;
         token = parseExpression(token);
@@ -1767,7 +1775,7 @@
   Token parseArguments(Token token) {
     Token begin = token;
     listener.beginArguments(begin);
-    assert('(' === token.stringValue);
+    assert(identical('(', token.stringValue));
     int argumentCount = 0;
     if (optional(')', token.next)) {
       listener.endArguments(argumentCount, begin, token.next);
@@ -1782,7 +1790,7 @@
         colon = token;
       }
       token = parseExpression(token.next);
-      if (colon !== null) listener.handleNamedArgument(colon);
+      if (colon != null) listener.handleNamedArgument(colon);
       ++argumentCount;
     } while (optional(',', token));
     mayParseFunctionExpressions = old;
@@ -1801,7 +1809,7 @@
     token = parseType(token.next);
     listener.handleIsOperator(operator, not, token);
     String value = token.stringValue;
-    if (value === 'is' || value === 'as') {
+    if (identical(value, 'is') || identical(value, 'as')) {
       // The is- and as-operators cannot be chained, but they can take part of
       // expressions like: foo is Foo || foo is Bar.
       listener.unexpected(token);
@@ -1815,7 +1823,7 @@
     token = parseType(token.next);
     listener.handleAsOperator(operator, token);
     String value = token.stringValue;
-    if (value === 'is' || value === 'as') {
+    if (identical(value, 'is') || identical(value, 'as')) {
       // The is- and as-operators cannot be chained.
       listener.unexpected(token);
     }
@@ -1879,19 +1887,19 @@
 
   Token parseVariablesDeclarationOrExpressionOpt(Token token) {
     final String value = token.stringValue;
-    if (value === ';') {
+    if (identical(value, ';')) {
       listener.handleNoExpression(token);
       return token;
-    } else if ((value === 'var') || (value === 'final')) {
+    } else if ((identical(value, 'var')) || (identical(value, 'final'))) {
       return parseVariablesDeclarationNoSemicolon(token);
     }
     Token identifier = peekIdentifierAfterType(token);
-    if (identifier !== null) {
+    if (identifier != null) {
       assert(identifier.isIdentifier());
       Token afterId = identifier.next;
       int afterIdKind = afterId.kind;
-      if (afterIdKind === EQ_TOKEN || afterIdKind === SEMICOLON_TOKEN ||
-          afterIdKind === COMMA_TOKEN || optional('in', afterId)) {
+      if (identical(afterIdKind, EQ_TOKEN) || identical(afterIdKind, SEMICOLON_TOKEN) ||
+          identical(afterIdKind, COMMA_TOKEN) || optional('in', afterId)) {
         return parseVariablesDeclarationNoSemicolon(token);
       }
     }
@@ -1989,16 +1997,16 @@
     int catchCount = 0;
 
     String value = token.stringValue;
-    while (value === 'catch' || value === 'on') {
+    while (identical(value, 'catch') || identical(value, 'on')) {
       var onKeyword = null;
-      if (value === 'on') {
+      if (identical(value, 'on')) {
         // on qualified catchPart?
         onKeyword = token;
         token = parseType(token.next);
         value = token.stringValue;
       }
       Token catchKeyword = null;
-      if (value === 'catch') {
+      if (identical(value, 'catch')) {
         catchKeyword = token;
         // TODO(ahe): Validate the "parameters".
         token = parseFormalParameters(token.next);
@@ -2034,7 +2042,7 @@
     listener.beginSwitchBlock(begin);
     token = expect('{', token);
     int caseCount = 0;
-    while (token.kind !== EOF_TOKEN) {
+    while (!identical(token.kind, EOF_TOKEN)) {
       if (optional('}', token)) {
         break;
       }
@@ -2071,8 +2079,8 @@
     while (true) {
       // Loop until we find something that can't be part of a switch case.
       String value = peek.stringValue;
-      if (value === 'default') {
-        while (token !== peek) {
+      if (identical(value, 'default')) {
+        while (!identical(token, peek)) {
           token = parseLabel(token);
           labelCount++;
         }
@@ -2080,8 +2088,8 @@
         token = expect(':', token.next);
         peek = token;
         break;
-      } else if (value === 'case') {
-        while (token !== peek) {
+      } else if (identical(value, 'case')) {
+        while (!identical(token, peek)) {
           token = parseLabel(token);
           labelCount++;
         }
@@ -2101,11 +2109,11 @@
     }
     // Finally zero or more statements.
     int statementCount = 0;
-    while (token.kind !== EOF_TOKEN) {
+    while (!identical(token.kind, EOF_TOKEN)) {
       String value = peek.stringValue;
-      if ((value === 'case') ||
-          (value === 'default') ||
-          ((value === '}') && (token === peek))) {
+      if ((identical(value, 'case')) ||
+          (identical(value, 'default')) ||
+          ((identical(value, '}')) && (identical(token, peek)))) {
         // A label just before "}" will be handled as a statement error.
         break;
       } else {
diff --git a/lib/compiler/implementation/scanner/partial_parser.dart b/lib/compiler/implementation/scanner/partial_parser.dart
index bbdaca8..fe2bcd7 100644
--- a/lib/compiler/implementation/scanner/partial_parser.dart
+++ b/lib/compiler/implementation/scanner/partial_parser.dart
@@ -27,49 +27,49 @@
     while (true) {
       final kind = token.kind;
       final value = token.stringValue;
-      if ((kind === EOF_TOKEN) ||
-          (value === ';') ||
-          (value === ',') ||
-          (value === ']'))
+      if ((identical(kind, EOF_TOKEN)) ||
+          (identical(value, ';')) ||
+          (identical(value, ',')) ||
+          (identical(value, ']')))
         return token;
-      if (value === '=') {
+      if (identical(value, '=')) {
         var nextValue = token.next.stringValue;
-        if (nextValue === 'const') {
+        if (identical(nextValue, 'const')) {
           token = token.next;
           nextValue = token.next.stringValue;
         }
-        if (nextValue === '{') {
+        if (identical(nextValue, '{')) {
           // Handle cases like this:
           // class Foo {
           //   var map;
           //   Foo() : map = {};
           // }
           BeginGroupToken begin = token.next;
-          token = (begin.endGroup !== null) ? begin.endGroup : token;
+          token = (begin.endGroup != null) ? begin.endGroup : token;
           token = token.next;
           continue;
         }
-        if (nextValue === '<') {
+        if (identical(nextValue, '<')) {
           // Handle cases like this:
           // class Foo {
           //   var map;
           //   Foo() : map = <String, Foo>{};
           // }
           BeginGroupToken begin = token.next;
-          token = (begin.endGroup !== null) ? begin.endGroup : token;
+          token = (begin.endGroup != null) ? begin.endGroup : token;
           token = token.next;
-          if (token.stringValue === '{') {
+          if (identical(token.stringValue, '{')) {
             begin = token;
-            token = (begin.endGroup !== null) ? begin.endGroup : token;
+            token = (begin.endGroup != null) ? begin.endGroup : token;
             token = token.next;
           }
           continue;
         }
       }
-      if (!mayParseFunctionExpressions && value === '{') return token;
+      if (!mayParseFunctionExpressions && identical(value, '{')) return token;
       if (token is BeginGroupToken) {
         BeginGroupToken begin = token;
-        token = (begin.endGroup !== null) ? begin.endGroup : token;
+        token = (begin.endGroup != null) ? begin.endGroup : token;
       }
       token = token.next;
     }
@@ -81,9 +81,9 @@
     }
     BeginGroupToken beginGroupToken = token;
     Token endGroup = beginGroupToken.endGroup;
-    if (endGroup === null) {
+    if (endGroup == null) {
       return listener.unmatched(beginGroupToken);
-    } else if (endGroup.kind !== $CLOSE_CURLY_BRACKET) {
+    } else if (!identical(endGroup.kind, $CLOSE_CURLY_BRACKET)) {
       return listener.unmatched(beginGroupToken);
     }
     return endGroup;
@@ -92,11 +92,14 @@
   Token parseFunctionBody(Token token, bool isExpression) {
     assert(!isExpression);
     String value = token.stringValue;
-    if (value === ';') {
+    if (identical(value, ';')) {
       // No body.
-    } else if (value === '=>') {
+    } else if (identical(value, '=>')) {
       token = parseExpression(token.next);
       expectSemicolon(token);
+    } else if (value === '=') {
+      token = parseRedirectingFactoryBody(token);
+      expectSemicolon(token);
     } else {
       token = skipBlock(token);
     }
diff --git a/lib/compiler/implementation/scanner/scanner.dart b/lib/compiler/implementation/scanner/scanner.dart
index 053304f..7c51c03 100644
--- a/lib/compiler/implementation/scanner/scanner.dart
+++ b/lib/compiler/implementation/scanner/scanner.dart
@@ -92,7 +92,7 @@
 
   Token tokenize() {
     int next = advance();
-    while (next !== $EOF) {
+    while (!identical(next, $EOF)) {
       next = bigSwitch(next);
     }
     appendEofToken();
@@ -101,10 +101,11 @@
 
   int bigSwitch(int next) {
     beginToken();
-    if (next === $SPACE || next === $TAB || next === $LF || next === $CR) {
+    if (identical(next, $SPACE) || identical(next, $TAB)
+        || identical(next, $LF) || identical(next, $CR)) {
       appendWhiteSpace(next);
       next = advance();
-      while (next === $SPACE) {
+      while (identical(next, $SPACE)) {
         appendWhiteSpace(next);
         next = advance();
       }
@@ -112,156 +113,156 @@
     }
 
     if ($a <= next && next <= $z) {
-      if ($r === next) {
+      if (identical($r, next)) {
         return tokenizeRawStringKeywordOrIdentifier(next);
       }
       return tokenizeKeywordOrIdentifier(next, true);
     }
 
-    if (($A <= next && next <= $Z) || next === $_ || next === $$) {
+    if (($A <= next && next <= $Z) || identical(next, $_) || identical(next, $$)) {
       return tokenizeIdentifier(next, byteOffset, true);
     }
 
-    if (next === $LT) {
+    if (identical(next, $LT)) {
       return tokenizeLessThan(next);
     }
 
-    if (next === $GT) {
+    if (identical(next, $GT)) {
       return tokenizeGreaterThan(next);
     }
 
-    if (next === $EQ) {
+    if (identical(next, $EQ)) {
       return tokenizeEquals(next);
     }
 
-    if (next === $BANG) {
+    if (identical(next, $BANG)) {
       return tokenizeExclamation(next);
     }
 
-    if (next === $PLUS) {
+    if (identical(next, $PLUS)) {
       return tokenizePlus(next);
     }
 
-    if (next === $MINUS) {
+    if (identical(next, $MINUS)) {
       return tokenizeMinus(next);
     }
 
-    if (next === $STAR) {
+    if (identical(next, $STAR)) {
       return tokenizeMultiply(next);
     }
 
-    if (next === $PERCENT) {
+    if (identical(next, $PERCENT)) {
       return tokenizePercent(next);
     }
 
-    if (next === $AMPERSAND) {
+    if (identical(next, $AMPERSAND)) {
       return tokenizeAmpersand(next);
     }
 
-    if (next === $BAR) {
+    if (identical(next, $BAR)) {
       return tokenizeBar(next);
     }
 
-    if (next === $CARET) {
+    if (identical(next, $CARET)) {
       return tokenizeCaret(next);
     }
 
-    if (next === $OPEN_SQUARE_BRACKET) {
+    if (identical(next, $OPEN_SQUARE_BRACKET)) {
       return tokenizeOpenSquareBracket(next);
     }
 
-    if (next === $TILDE) {
+    if (identical(next, $TILDE)) {
       return tokenizeTilde(next);
     }
 
-    if (next === $BACKSLASH) {
+    if (identical(next, $BACKSLASH)) {
       appendPrecedenceToken(BACKSLASH_INFO);
       return advance();
     }
 
-    if (next === $HASH) {
+    if (identical(next, $HASH)) {
       return tokenizeTag(next);
     }
 
-    if (next === $OPEN_PAREN) {
+    if (identical(next, $OPEN_PAREN)) {
       appendBeginGroup(OPEN_PAREN_INFO, "(");
       return advance();
     }
 
-    if (next === $CLOSE_PAREN) {
+    if (identical(next, $CLOSE_PAREN)) {
       return appendEndGroup(CLOSE_PAREN_INFO, ")", OPEN_PAREN_TOKEN);
     }
 
-    if (next === $COMMA) {
+    if (identical(next, $COMMA)) {
       appendPrecedenceToken(COMMA_INFO);
       return advance();
     }
 
-    if (next === $COLON) {
+    if (identical(next, $COLON)) {
       appendPrecedenceToken(COLON_INFO);
       return advance();
     }
 
-    if (next === $SEMICOLON) {
+    if (identical(next, $SEMICOLON)) {
       appendPrecedenceToken(SEMICOLON_INFO);
       // Type parameters and arguments cannot contain semicolon.
       discardOpenLt();
       return advance();
     }
 
-    if (next === $QUESTION) {
+    if (identical(next, $QUESTION)) {
       appendPrecedenceToken(QUESTION_INFO);
       return advance();
     }
 
-    if (next === $CLOSE_SQUARE_BRACKET) {
+    if (identical(next, $CLOSE_SQUARE_BRACKET)) {
       return appendEndGroup(CLOSE_SQUARE_BRACKET_INFO, "]",
                             OPEN_SQUARE_BRACKET_TOKEN);
     }
 
-    if (next === $BACKPING) {
+    if (identical(next, $BACKPING)) {
       appendPrecedenceToken(BACKPING_INFO);
       return advance();
     }
 
-    if (next === $OPEN_CURLY_BRACKET) {
+    if (identical(next, $OPEN_CURLY_BRACKET)) {
       appendBeginGroup(OPEN_CURLY_BRACKET_INFO, "{");
       return advance();
     }
 
-    if (next === $CLOSE_CURLY_BRACKET) {
+    if (identical(next, $CLOSE_CURLY_BRACKET)) {
       return appendEndGroup(CLOSE_CURLY_BRACKET_INFO, "}",
                             OPEN_CURLY_BRACKET_TOKEN);
     }
 
-    if (next === $SLASH) {
+    if (identical(next, $SLASH)) {
       return tokenizeSlashOrComment(next);
     }
 
-    // TODO(aprelev@gmail.com) Remove deprecated raw string literals
-    if (next === $AT) {
-      return tokenizeAtOrRawString(next);
+    if (identical(next, $AT)) {
+      return tokenizeAt(next);
     }
 
-    if (next === $DQ || next === $SQ) {
+    if (identical(next, $DQ) || identical(next, $SQ)) {
       return tokenizeString(next, byteOffset, false);
     }
 
-    if (next === $PERIOD) {
+    if (identical(next, $PERIOD)) {
       return tokenizeDotsOrNumber(next);
     }
 
-    if (next === $0) {
+    if (identical(next, $0)) {
       return tokenizeHexOrNumber(next);
     }
 
     // TODO(ahe): Would a range check be faster?
-    if (next === $1 || next === $2 || next === $3 || next === $4 ||  next === $5
-        || next === $6 || next === $7 || next === $8 || next === $9) {
+    if (identical(next, $1) || identical(next, $2) || identical(next, $3) 
+        || identical(next, $4) ||  identical(next, $5) || identical(next, $6)
+        || identical(next, $7) || identical(next, $8) || identical(next, $9)) {
       return tokenizeNumber(next);
     }
 
-    if (next === $EOF) {
+    if (identical(next, $EOF)) {
       return $EOF;
     }
     if (next < 0x1f) {
@@ -270,7 +271,7 @@
 
     // The following are non-ASCII characters.
 
-    if (next === $NBSP) {
+    if (identical(next, $NBSP)) {
       appendWhiteSpace(next);
       return advance();
     }
@@ -280,11 +281,11 @@
 
   int tokenizeTag(int next) {
     // # or #!.*[\n\r]
-    if (byteOffset === 0) {
-      if (peek() === $BANG) {
+    if (byteOffset == 0) {
+      if (identical(peek(), $BANG)) {
         do {
           next = advance();
-        } while (next !== $LF && next !== $CR && next !== $EOF);
+        } while (!identical(next, $LF) && !identical(next, $CR) && !identical(next, $EOF));
         return next;
       }
     }
@@ -295,7 +296,7 @@
   int tokenizeTilde(int next) {
     // ~ ~/ ~/=
     next = advance();
-    if (next === $SLASH) {
+    if (identical(next, $SLASH)) {
       return select($EQ, TILDE_SLASH_EQ_INFO, TILDE_SLASH_INFO);
     } else {
       appendPrecedenceToken(TILDE_INFO);
@@ -306,9 +307,9 @@
   int tokenizeOpenSquareBracket(int next) {
     // [ [] []=
     next = advance();
-    if (next === $CLOSE_SQUARE_BRACKET) {
+    if (identical(next, $CLOSE_SQUARE_BRACKET)) {
       Token token = previousToken();
-      if (token is KeywordToken && token.value.stringValue === 'operator') {
+      if (token is KeywordToken && identical(token.value.stringValue, 'operator')) {
         return select($EQ, INDEX_EQ_INFO, INDEX_INFO);
       }
     }
@@ -324,10 +325,10 @@
   int tokenizeBar(int next) {
     // | || |=
     next = advance();
-    if (next === $BAR) {
+    if (identical(next, $BAR)) {
       appendPrecedenceToken(BAR_BAR_INFO);
       return advance();
-    } else if (next === $EQ) {
+    } else if (identical(next, $EQ)) {
       appendPrecedenceToken(BAR_EQ_INFO);
       return advance();
     } else {
@@ -339,10 +340,10 @@
   int tokenizeAmpersand(int next) {
     // && &= &
     next = advance();
-    if (next === $AMPERSAND) {
+    if (identical(next, $AMPERSAND)) {
       appendPrecedenceToken(AMPERSAND_AMPERSAND_INFO);
       return advance();
-    } else if (next === $EQ) {
+    } else if (identical(next, $EQ)) {
       appendPrecedenceToken(AMPERSAND_EQ_INFO);
       return advance();
     } else {
@@ -364,10 +365,10 @@
   int tokenizeMinus(int next) {
     // - -- -=
     next = advance();
-    if (next === $MINUS) {
+    if (identical(next, $MINUS)) {
       appendPrecedenceToken(MINUS_MINUS_INFO);
       return advance();
-    } else if (next === $EQ) {
+    } else if (identical(next, $EQ)) {
       appendPrecedenceToken(MINUS_EQ_INFO);
       return advance();
     } else {
@@ -380,10 +381,10 @@
   int tokenizePlus(int next) {
     // + ++ +=
     next = advance();
-    if ($PLUS === next) {
+    if (identical($PLUS, next)) {
       appendPrecedenceToken(PLUS_PLUS_INFO);
       return advance();
-    } else if ($EQ === next) {
+    } else if (identical($EQ, next)) {
       appendPrecedenceToken(PLUS_EQ_INFO);
       return advance();
     } else {
@@ -395,7 +396,7 @@
   int tokenizeExclamation(int next) {
     // ! != !==
     next = advance();
-    if (next === $EQ) {
+    if (identical(next, $EQ)) {
       return select($EQ, BANG_EQ_EQ_INFO, BANG_EQ_INFO);
     }
     appendPrecedenceToken(BANG_INFO);
@@ -410,9 +411,9 @@
     discardOpenLt();
 
     next = advance();
-    if (next === $EQ) {
+    if (identical(next, $EQ)) {
       return select($EQ, EQ_EQ_EQ_INFO, EQ_EQ_INFO);
-    } else if (next === $GT) {
+    } else if (identical(next, $GT)) {
       appendPrecedenceToken(FUNCTION_INFO);
       return advance();
     }
@@ -423,12 +424,12 @@
   int tokenizeGreaterThan(int next) {
     // > >= >> >>= >>> >>>=
     next = advance();
-    if ($EQ === next) {
+    if (identical($EQ, next)) {
       appendPrecedenceToken(GT_EQ_INFO);
       return advance();
-    } else if ($GT === next) {
+    } else if (identical($GT, next)) {
       next = advance();
-      if ($EQ === next) {
+      if (identical($EQ, next)) {
         appendPrecedenceToken(GT_GT_EQ_INFO);
         return advance();
       } else {
@@ -444,10 +445,10 @@
   int tokenizeLessThan(int next) {
     // < <= << <<=
     next = advance();
-    if ($EQ === next) {
+    if (identical($EQ, next)) {
       appendPrecedenceToken(LT_EQ_INFO);
       return advance();
-    } else if ($LT === next) {
+    } else if (identical($LT, next)) {
       return select($EQ, LT_LT_EQ_INFO, LT_LT_INFO);
     } else {
       appendBeginGroup(LT_INFO, "<");
@@ -461,9 +462,10 @@
       next = advance();
       if ($0 <= next && next <= $9) {
         continue;
-      } else if (next === $PERIOD) {
+      } else if (identical(next, $PERIOD)) {
         return tokenizeFractionPart(advance(), start);
-      } else if (next === $e || next === $E || next === $d || next === $D) {
+      } else if (identical(next, $e) || identical(next, $E)
+          || identical(next, $d) || identical(next, $D)) {
         return tokenizeFractionPart(next, start);
       } else {
         appendByteStringToken(INT_INFO, asciiString(start, 0));
@@ -474,7 +476,7 @@
 
   int tokenizeHexOrNumber(int next) {
     int x = peek();
-    if (x === $x || x === $X) {
+    if (identical(x, $x) || identical(x, $X)) {
       advance();
       return tokenizeHex(x);
     }
@@ -505,7 +507,7 @@
     next = advance();
     if (($0 <= next && next <= $9)) {
       return tokenizeFractionPart(next, start);
-    } else if ($PERIOD === next) {
+    } else if (identical($PERIOD, next)) {
       return select($PERIOD, PERIOD_PERIOD_PERIOD_INFO, PERIOD_PERIOD_INFO);
     } else {
       appendPrecedenceToken(PERIOD_INFO);
@@ -519,7 +521,7 @@
     LOOP: while (!done) {
       if ($0 <= next && next <= $9) {
         hasDigit = true;
-      } else if ($e === next || $E === next) {
+      } else if (identical($e, next) || identical($E, next)) {
         hasDigit = true;
         next = tokenizeExponent(advance());
         done = true;
@@ -532,14 +534,14 @@
     }
     if (!hasDigit) {
       appendByteStringToken(INT_INFO, asciiString(start, -1));
-      if ($PERIOD === next) {
+      if (identical($PERIOD, next)) {
         return select($PERIOD, PERIOD_PERIOD_PERIOD_INFO, PERIOD_PERIOD_INFO);
       }
       // TODO(ahe): Wrong offset for the period.
       appendPrecedenceToken(PERIOD_INFO);
       return bigSwitch(next);
     }
-    if (next === $d || next === $D) {
+    if (identical(next, $d) || identical(next, $D)) {
       next = advance();
     }
     appendByteStringToken(DOUBLE_INFO, asciiString(start, 0));
@@ -547,7 +549,7 @@
   }
 
   int tokenizeExponent(int next) {
-    if (next === $PLUS || next === $MINUS) {
+    if (identical(next, $PLUS) || identical(next, $MINUS)) {
       next = advance();
     }
     bool hasDigits = false;
@@ -566,11 +568,11 @@
 
   int tokenizeSlashOrComment(int next) {
     next = advance();
-    if ($STAR === next) {
+    if (identical($STAR, next)) {
       return tokenizeMultiLineComment(next);
-    } else if ($SLASH === next) {
+    } else if (identical($SLASH, next)) {
       return tokenizeSingleLineComment(next);
-    } else if ($EQ === next) {
+    } else if (identical($EQ, next)) {
       appendPrecedenceToken(SLASH_EQ_INFO);
       return advance();
     } else {
@@ -582,7 +584,7 @@
   int tokenizeSingleLineComment(int next) {
     while (true) {
       next = advance();
-      if ($LF === next || $CR === next || $EOF === next) {
+      if (identical($LF, next) || identical($CR, next) || identical($EOF, next)) {
         appendComment();
         return next;
       }
@@ -593,14 +595,14 @@
     int nesting = 1;
     next = advance();
     while (true) {
-      if ($EOF === next) {
+      if (identical($EOF, next)) {
         // TODO(ahe): Report error.
         return next;
-      } else if ($STAR === next) {
+      } else if (identical($STAR, next)) {
         next = advance();
-        if ($SLASH === next) {
+        if (identical($SLASH, next)) {
           --nesting;
-          if (0 === nesting) {
+          if (0 == nesting) {
             next = advance();
             appendComment();
             return next;
@@ -608,9 +610,9 @@
             next = advance();
           }
         }
-      } else if ($SLASH === next) {
+      } else if (identical($SLASH, next)) {
         next = advance();
-        if ($STAR === next) {
+        if (identical($STAR, next)) {
           next = advance();
           ++nesting;
         }
@@ -622,7 +624,7 @@
 
   int tokenizeRawStringKeywordOrIdentifier(int next) {
     int nextnext = peek();
-    if (nextnext === $DQ || nextnext === $SQ) {
+    if (identical(nextnext, $DQ) || identical(nextnext, $SQ)) {
       int start = byteOffset;
       next = advance();
       return tokenizeString(next, start, true);
@@ -633,17 +635,17 @@
   int tokenizeKeywordOrIdentifier(int next, bool allowDollar) {
     KeywordState state = KeywordState.KEYWORD_STATE;
     int start = byteOffset;
-    while (state !== null && $a <= next && next <= $z) {
+    while (state != null && $a <= next && next <= $z) {
       state = state.next(next);
       next = advance();
     }
-    if (state === null || state.keyword === null) {
+    if (state == null || state.keyword == null) {
       return tokenizeIdentifier(next, start, allowDollar);
     }
     if (($A <= next && next <= $Z) ||
         ($0 <= next && next <= $9) ||
-        next === $_ ||
-        next === $$) {
+        identical(next, $_) ||
+        identical(next, $$)) {
       return tokenizeIdentifier(next, start, allowDollar);
     } else if (next < 128) {
       appendKeywordToken(state.keyword);
@@ -659,19 +661,19 @@
     // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support.
     bool isDynamicBuiltIn = false;
 
-    if (next === $D) {
+    if (identical(next, $D)) {
       next = advance();
-      if (next === $y) {
+      if (identical(next, $y)) {
         next = advance();
-        if (next === $n) {
+        if (identical(next, $n)) {
           next = advance();
-          if (next === $a) {
+          if (identical(next, $a)) {
             next = advance();
-            if (next === $m) {
+            if (identical(next, $m)) {
               next = advance();
-              if (next === $i) {
+              if (identical(next, $i)) {
                 next = advance();
-                if (next === $c) {
+                if (identical(next, $c)) {
                   isDynamicBuiltIn = true;
                   next = advance();
                 }
@@ -686,11 +688,11 @@
       if (($a <= next && next <= $z) ||
           ($A <= next && next <= $Z) ||
           ($0 <= next && next <= $9) ||
-          next === $_ ||
-          (next === $$ && allowDollar)) {
+          identical(next, $_) ||
+          (identical(next, $$) && allowDollar)) {
         isDynamicBuiltIn = false;
         next = advance();
-      } else if ((next < 128) || (next === $NBSP)) {
+      } else if ((next < 128) || (identical(next, $NBSP))) {
         // Identifier ends here.
         if (start == byteOffset) {
           return error(const SourceString("expected identifier"));
@@ -707,7 +709,7 @@
         int nonAsciiStart = byteOffset;
         do {
           next = nextByte();
-          if (next === $NBSP) break;
+          if (identical(next, $NBSP)) break;
         } while (next > 127);
         String string = utf8String(nonAsciiStart, -1).slowToString();
         isAscii = false;
@@ -717,23 +719,19 @@
     }
   }
 
-  int tokenizeAtOrRawString(int next) {
+  int tokenizeAt(int next) {
     int start = byteOffset;
     next = advance();
-    if (next === $DQ || next === $SQ) {
-      return tokenizeString(next, start, true);
-    } else {
-      appendPrecedenceToken(AT_INFO);
-      return next;
-    }
+    appendPrecedenceToken(AT_INFO);
+    return next;
   }
 
   int tokenizeString(int next, int start, bool raw) {
     int quoteChar = next;
     next = advance();
-    if (quoteChar === next) {
+    if (identical(quoteChar, next)) {
       next = advance();
-      if (quoteChar === next) {
+      if (identical(quoteChar, next)) {
         // Multiline string.
         return tokenizeMultiLineString(quoteChar, start, raw);
       } else {
@@ -756,15 +754,16 @@
   }
 
   int tokenizeSingleLineString(int next, int quoteChar, int start) {
-    while (next !== quoteChar) {
-      if (next === $BACKSLASH) {
+    while (!identical(next, quoteChar)) {
+      if (identical(next, $BACKSLASH)) {
         next = advance();
-      } else if (next === $$) {
+      } else if (identical(next, $$)) {
         next = tokenizeStringInterpolation(start);
         start = byteOffset;
         continue;
       }
-      if (next <= $CR && (next === $LF || next === $CR || next === $EOF)) {
+      if (next <= $CR
+          && (identical(next, $LF) || identical(next, $CR) || identical(next, $EOF))) {
         return error(const SourceString("unterminated string literal"));
       }
       next = advance();
@@ -777,7 +776,7 @@
     appendByteStringToken(STRING_INFO, utf8String(start, -1));
     beginToken(); // $ starts here.
     int next = advance();
-    if (next === $OPEN_CURLY_BRACKET) {
+    if (identical(next, $OPEN_CURLY_BRACKET)) {
       return tokenizeInterpolatedExpression(next, start);
     } else {
       return tokenizeInterpolatedIdentifier(next, start);
@@ -788,10 +787,10 @@
     appendBeginGroup(STRING_INTERPOLATION_INFO, "\${");
     beginToken(); // The expression starts here.
     next = advance();
-    while (next !== $EOF && next !== $STX) {
+    while (!identical(next, $EOF) && !identical(next, $STX)) {
       next = bigSwitch(next);
     }
-    if (next === $EOF) return next;
+    if (identical(next, $EOF)) return next;
     next = advance();
     beginToken(); // The string interpolation suffix starts here.
     return next;
@@ -808,10 +807,10 @@
   int tokenizeSingleLineRawString(int next, int quoteChar, int start) {
     next = advance();
     while (next != $EOF) {
-      if (next === quoteChar) {
+      if (identical(next, quoteChar)) {
         appendByteStringToken(STRING_INFO, utf8String(start, 0));
         return advance();
-      } else if (next === $LF || next === $CR) {
+      } else if (identical(next, $LF) || identical(next, $CR)) {
         return error(const SourceString("unterminated string literal"));
       }
       next = advance();
@@ -821,15 +820,15 @@
 
   int tokenizeMultiLineRawString(int quoteChar, int start) {
     int next = advance();
-    outer: while (next !== $EOF) {
-      while (next !== quoteChar) {
+    outer: while (!identical(next, $EOF)) {
+      while (!identical(next, quoteChar)) {
         next = advance();
-        if (next === $EOF) break outer;
+        if (identical(next, $EOF)) break outer;
       }
       next = advance();
-      if (next === quoteChar) {
+      if (identical(next, quoteChar)) {
         next = advance();
-        if (next === quoteChar) {
+        if (identical(next, quoteChar)) {
           appendByteStringToken(STRING_INFO, utf8String(start, 0));
           return advance();
         }
@@ -841,26 +840,26 @@
   int tokenizeMultiLineString(int quoteChar, int start, bool raw) {
     if (raw) return tokenizeMultiLineRawString(quoteChar, start);
     int next = advance();
-    while (next !== $EOF) {
-      if (next === $$) {
+    while (!identical(next, $EOF)) {
+      if (identical(next, $$)) {
         next = tokenizeStringInterpolation(start);
         start = byteOffset;
         continue;
       }
-      if (next === quoteChar) {
+      if (identical(next, quoteChar)) {
         next = advance();
-        if (next === quoteChar) {
+        if (identical(next, quoteChar)) {
           next = advance();
-          if (next === quoteChar) {
+          if (identical(next, quoteChar)) {
             appendByteStringToken(STRING_INFO, utf8String(start, 0));
             return advance();
           }
         }
         continue;
       }
-      if (next === $BACKSLASH) {
+      if (identical(next, $BACKSLASH)) {
         next = advance();
-        if (next === $EOF) break;
+        if (identical(next, $EOF)) break;
       }
       next = advance();
     }
diff --git a/lib/compiler/implementation/scanner/scannerlib.dart b/lib/compiler/implementation/scanner/scannerlib.dart
index e31886f..8341c9a 100644
--- a/lib/compiler/implementation/scanner/scannerlib.dart
+++ b/lib/compiler/implementation/scanner/scannerlib.dart
@@ -2,28 +2,28 @@
 // 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('scanner');
+library scanner;
 
-#import('dart:uri');
+import 'dart:uri';
 
-#import('scanner_implementation.dart');
-#import('../elements/elements.dart');
-#import('../leg.dart');
-#import('../native_handler.dart', prefix: 'native');
-#import('../string_validator.dart');
-#import('../tree/tree.dart');
-#import('../util/characters.dart');
-#import('../util/util.dart');
+import 'scanner_implementation.dart';
+import '../elements/elements.dart';
+import '../dart2jslib.dart';
+import '../native_handler.dart' as native;
+import '../string_validator.dart';
+import '../tree/tree.dart';
+import '../util/characters.dart';
+import '../util/util.dart';
 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed.
-#import('../../compiler.dart', prefix: 'api_s');
+import '../../compiler.dart' as api_s;
 
-#source('class_element_parser.dart');
-#source('keyword.dart');
-#source('listener.dart');
-#source('parser.dart');
-#source('parser_task.dart');
-#source('partial_parser.dart');
-#source('scanner.dart');
-#source('scanner_task.dart');
-#source('string_scanner.dart');
-#source('token.dart');
+part 'class_element_parser.dart';
+part 'keyword.dart';
+part 'listener.dart';
+part 'parser.dart';
+part 'parser_task.dart';
+part 'partial_parser.dart';
+part 'scanner.dart';
+part 'scanner_task.dart';
+part 'string_scanner.dart';
+part 'token.dart';
diff --git a/lib/compiler/implementation/scanner/string_scanner.dart b/lib/compiler/implementation/scanner/string_scanner.dart
index bdd9131..51851e2 100644
--- a/lib/compiler/implementation/scanner/string_scanner.dart
+++ b/lib/compiler/implementation/scanner/string_scanner.dart
@@ -9,7 +9,7 @@
 class StringScanner extends ArrayBasedScanner<SourceString> {
   final String string;
 
-  StringScanner(String this.string, [bool includeComments = false])
+  StringScanner(String this.string, {bool includeComments: false})
     : super(includeComments);
 
   int nextByte() => charAt(++byteOffset);
@@ -71,5 +71,5 @@
 
   bool isEmpty() => begin == end;
 
-  bool isPrivate() => !isEmpty() && internalString.charCodeAt(begin) === $_;
+  bool isPrivate() => !isEmpty() && identical(internalString.charCodeAt(begin), $_);
 }
diff --git a/lib/compiler/implementation/scanner/token.dart b/lib/compiler/implementation/scanner/token.dart
index 5a09c19..99055fe 100644
--- a/lib/compiler/implementation/scanner/token.dart
+++ b/lib/compiler/implementation/scanner/token.dart
@@ -121,7 +121,7 @@
    */
   int get precedence => info.precedence;
 
-  bool isIdentifier() => kind === IDENTIFIER_TOKEN;
+  bool isIdentifier() => identical(kind, IDENTIFIER_TOKEN);
 
   /**
    * Returns a textual representation of this token to be used for debugging
@@ -226,7 +226,7 @@
 
   bool isEmpty() => stringValue.isEmpty();
 
-  bool isPrivate() => !isEmpty() && stringValue.charCodeAt(0) === $_;
+  bool isPrivate() => !isEmpty() && identical(stringValue.charCodeAt(0), $_);
 }
 
 class StringCodeIterator implements Iterator<int> {
@@ -255,25 +255,25 @@
 
 bool isUserDefinableOperator(String value) {
   return
-    (value === '==') ||
-    (value === '~') ||
-    (value === '[]') ||
-    (value === '[]=') ||
-    (value === '*') ||
-    (value === '/') ||
-    (value === '%') ||
-    (value === '~/') ||
-    (value === '+') ||
-    (value === '-') ||
-    (value === '<<') ||
-    (value === '>>') ||
-    (value === '>=') ||
-    (value === '>') ||
-    (value === '<=') ||
-    (value === '<') ||
-    (value === '&') ||
-    (value === '^') ||
-    (value === '|');
+    (identical(value, '==')) ||
+    (identical(value, '~')) ||
+    (identical(value, '[]')) ||
+    (identical(value, '[]=')) ||
+    (identical(value, '*')) ||
+    (identical(value, '/')) ||
+    (identical(value, '%')) ||
+    (identical(value, '~/')) ||
+    (identical(value, '+')) ||
+    (identical(value, '-')) ||
+    (identical(value, '<<')) ||
+    (identical(value, '>>')) ||
+    (identical(value, '>=')) ||
+    (identical(value, '>')) ||
+    (identical(value, '<=')) ||
+    (identical(value, '<')) ||
+    (identical(value, '&')) ||
+    (identical(value, '^')) ||
+    (identical(value, '|'));
 }
 
 class PrecedenceInfo {
diff --git a/lib/compiler/implementation/script.dart b/lib/compiler/implementation/script.dart
index f703630..79dc7d7 100644
--- a/lib/compiler/implementation/script.dart
+++ b/lib/compiler/implementation/script.dart
@@ -10,6 +10,6 @@
   final Uri uri;
   Script(this.uri, this.file);
 
-  String get text => (file === null) ? null : file.text;
-  String get name => (file === null) ? null : file.filename;
+  String get text => (file == null) ? null : file.text;
+  String get name => (file == null) ? null : file.filename;
 }
diff --git a/lib/compiler/implementation/source_map_builder.dart b/lib/compiler/implementation/source_map_builder.dart
index 0b081ac..a29b0fe 100644
--- a/lib/compiler/implementation/source_map_builder.dart
+++ b/lib/compiler/implementation/source_map_builder.dart
@@ -90,7 +90,7 @@
     encodeVLQ(output, targetColumn - previousTargetColumn);
     previousTargetColumn = targetColumn;
 
-    if (entry.sourceLocation === null) return;
+    if (entry.sourceLocation == null) return;
 
     String sourceUrl = entry.sourceLocation.getSourceUrl();
     int sourceLine = entry.sourceLocation.getLine();
@@ -106,7 +106,7 @@
     encodeVLQ(output, sourceColumn - previousSourceColumn);
     previousSourceColumn = sourceColumn;
 
-    if (sourceName === null) {
+    if (sourceName == null) {
       return;
     }
 
diff --git a/lib/compiler/implementation/ssa/bailout.dart b/lib/compiler/implementation/ssa/bailout.dart
index 859a3d8..af15533 100644
--- a/lib/compiler/implementation/ssa/bailout.dart
+++ b/lib/compiler/implementation/ssa/bailout.dart
@@ -92,7 +92,7 @@
     block.forEachPhi(visitInstruction);
 
     HInstruction instruction = block.first;
-    while (instruction !== null) {
+    while (instruction != null) {
       // Note that visitInstruction (from the phis and here) might insert an
       // HTypeGuard instruction. We have to skip those.
       if (instruction is !HTypeGuard) visitInstruction(instruction);
@@ -116,10 +116,10 @@
     // Do not insert a type guard if the instruction has a type
     // annotation that disagrees with the speculated type.
     Element source = instruction.sourceElement;
-    if (source !== null) {
+    if (source != null) {
       DartType sourceType = source.computeType(compiler);
       DartType speculatedType = speculativeType.computeType(compiler);
-      if (speculatedType !== null
+      if (speculatedType != null
           && !compiler.types.isAssignable(speculatedType, sourceType)) {
         return false;
       }
@@ -130,10 +130,10 @@
 
     // Insert type guards if there are uses in loops.
     bool isNested(HBasicBlock inner, HBasicBlock outer) {
-      if (inner === outer) return false;
-      if (outer === null) return true;
-      while (inner !== null) {
-        if (inner === outer) return true;
+      if (identical(inner, outer)) return false;
+      if (outer == null) return true;
+      while (inner != null) {
+        if (identical(inner, outer)) return true;
         inner = inner.parentLoopHeader;
       }
       return false;
@@ -302,7 +302,7 @@
     for (int i = 0; i < block.successors.length; i++) {
       HBasicBlock successor = block.successors[i];
       Environment successorEnv = liveInstructions[successor];
-      if (successorEnv !== null) {
+      if (successorEnv != null) {
         environment.addAll(successorEnv);
       } else {
         // If we haven't computed the liveInstructions of that successor, we
@@ -430,7 +430,7 @@
     if (block.isLoopHeader()) {
       blocks.addLast(block);
     } else if (block.isLabeledBlock()
-               && (blocks.isEmpty() || blocks.last() !== block)) {
+               && (blocks.isEmpty() || !identical(blocks.last(), block))) {
       HLabeledBlockInformation info = block.blockFlow.body;
       visitStatements(info.body);
       return;
@@ -460,7 +460,7 @@
 
     if (start.isLabeledBlock()) {
       HBasicBlock continuation = start.blockFlow.continuation;
-      if (continuation !== null) {
+      if (continuation != null) {
         visitBasicBlock(continuation);
       }
     }
@@ -475,8 +475,8 @@
     preVisitedBlocks++;
 
     HBasicBlock joinBlock = instruction.joinBlock;
-    if (joinBlock !== null
-        && joinBlock.dominator !== instruction.block) {
+    if (joinBlock != null
+        && !identical(joinBlock.dominator, instruction.block)) {
       // The join block is dominated by a block in one of the branches.
       // The subgraph traversal never reached it, so we visit it here
       // instead.
@@ -498,7 +498,7 @@
   void visitGoto(HGoto goto) {
     HBasicBlock block = goto.block;
     HBasicBlock successor = block.successors[0];
-    if (successor.dominator === block) {
+    if (identical(successor.dominator, block)) {
       visitBasicBlock(block.successors[0]);
     }
   }
@@ -514,7 +514,7 @@
 
     // If the branch does not dominate the code after the loop, the
     // dominator will visit it.
-    if (branchBlock.successors[1].dominator !== branchBlock) return;
+    if (!identical(branchBlock.successors[1].dominator, branchBlock)) return;
 
     visitBasicBlock(branchBlock.successors[1]);
     // With labeled breaks we can have more dominated blocks.
@@ -531,7 +531,7 @@
       maxBailoutParameters = inputLength;
     }
     if (blocks.isEmpty()) {
-      if (firstBailoutTarget === null) {
+      if (firstBailoutTarget == null) {
         firstBailoutTarget = target;
       } else {
         hasComplexBailoutTargets = true;
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 7c573d4..d48f76e 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -8,38 +8,38 @@
 
   SourceString mapOperatorToMethodName(Operator op) {
     String name = op.source.stringValue;
-    if (name === '+') return const SourceString('add');
-    if (name === '-') return const SourceString('sub');
-    if (name === '*') return const SourceString('mul');
-    if (name === '/') return const SourceString('div');
-    if (name === '~/') return const SourceString('tdiv');
-    if (name === '%') return const SourceString('mod');
-    if (name === '<<') return const SourceString('shl');
-    if (name === '>>') return const SourceString('shr');
-    if (name === '|') return const SourceString('or');
-    if (name === '&') return const SourceString('and');
-    if (name === '^') return const SourceString('xor');
-    if (name === '<') return const SourceString('lt');
-    if (name === '<=') return const SourceString('le');
-    if (name === '>') return const SourceString('gt');
-    if (name === '>=') return const SourceString('ge');
-    if (name === '==') return const SourceString('eq');
-    if (name === '!=') return const SourceString('eq');
-    if (name === '===') return const SourceString('eqq');
-    if (name === '!==') return const SourceString('eqq');
-    if (name === '+=') return const SourceString('add');
-    if (name === '-=') return const SourceString('sub');
-    if (name === '*=') return const SourceString('mul');
-    if (name === '/=') return const SourceString('div');
-    if (name === '~/=') return const SourceString('tdiv');
-    if (name === '%=') return const SourceString('mod');
-    if (name === '<<=') return const SourceString('shl');
-    if (name === '>>=') return const SourceString('shr');
-    if (name === '|=') return const SourceString('or');
-    if (name === '&=') return const SourceString('and');
-    if (name === '^=') return const SourceString('xor');
-    if (name === '++') return const SourceString('add');
-    if (name === '--') return const SourceString('sub');
+    if (identical(name, '+')) return const SourceString('add');
+    if (identical(name, '-')) return const SourceString('sub');
+    if (identical(name, '*')) return const SourceString('mul');
+    if (identical(name, '/')) return const SourceString('div');
+    if (identical(name, '~/')) return const SourceString('tdiv');
+    if (identical(name, '%')) return const SourceString('mod');
+    if (identical(name, '<<')) return const SourceString('shl');
+    if (identical(name, '>>')) return const SourceString('shr');
+    if (identical(name, '|')) return const SourceString('or');
+    if (identical(name, '&')) return const SourceString('and');
+    if (identical(name, '^')) return const SourceString('xor');
+    if (identical(name, '<')) return const SourceString('lt');
+    if (identical(name, '<=')) return const SourceString('le');
+    if (identical(name, '>')) return const SourceString('gt');
+    if (identical(name, '>=')) return const SourceString('ge');
+    if (identical(name, '==')) return const SourceString('eq');
+    if (identical(name, '!=')) return const SourceString('eq');
+    if (identical(name, '===')) return const SourceString('eqq');
+    if (identical(name, '!==')) return const SourceString('eqq');
+    if (identical(name, '+=')) return const SourceString('add');
+    if (identical(name, '-=')) return const SourceString('sub');
+    if (identical(name, '*=')) return const SourceString('mul');
+    if (identical(name, '/=')) return const SourceString('div');
+    if (identical(name, '~/=')) return const SourceString('tdiv');
+    if (identical(name, '%=')) return const SourceString('mod');
+    if (identical(name, '<<=')) return const SourceString('shl');
+    if (identical(name, '>>=')) return const SourceString('shr');
+    if (identical(name, '|=')) return const SourceString('or');
+    if (identical(name, '&=')) return const SourceString('and');
+    if (identical(name, '^=')) return const SourceString('xor');
+    if (identical(name, '++')) return const SourceString('add');
+    if (identical(name, '--')) return const SourceString('sub');
     compiler.unimplemented('Unknown operator', node: op);
   }
 
@@ -60,7 +60,7 @@
   Element getStaticInterceptor(SourceString name, int parameters) {
     String mangledName = name.slowToString();
     Element element = compiler.findInterceptor(new SourceString(mangledName));
-    if (element !== null && element.isFunction()) {
+    if (element != null && element.isFunction()) {
       // Only pick the function element with the short name if the
       // number of parameters it expects matches the number we're
       // passing modulo the receiver.
@@ -87,17 +87,17 @@
   }
 
   Element getBoolifiedVersionOf(Element interceptor) {
-    if (interceptor === null) return interceptor;
+    if (interceptor == null) return interceptor;
     String boolifiedName = "${interceptor.name.slowToString()}B";
     return compiler.findHelper(new SourceString(boolifiedName));
   }
 
   Element getPrefixOperatorInterceptor(Operator op) {
     String name = op.source.stringValue;
-    if (name === '~') {
+    if (identical(name, '~')) {
       return compiler.findHelper(const SourceString('not'));
     }
-    if (name === '-') {
+    if (identical(name, '-')) {
       return compiler.findHelper(const SourceString('neg'));
     }
     compiler.unimplemented('Unknown operator', node: op);
@@ -180,25 +180,25 @@
       SsaBuilder builder = new SsaBuilder(constantSystem, this, work);
       HGraph graph;
       ElementKind kind = element.kind;
-      if (kind === ElementKind.GENERATIVE_CONSTRUCTOR) {
+      if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR)) {
         graph = compileConstructor(builder, work);
-      } else if (kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY ||
-                 kind === ElementKind.FUNCTION ||
-                 kind === ElementKind.GETTER ||
-                 kind === ElementKind.SETTER) {
+      } else if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR_BODY) ||
+                 identical(kind, ElementKind.FUNCTION) ||
+                 identical(kind, ElementKind.GETTER) ||
+                 identical(kind, ElementKind.SETTER)) {
         graph = builder.buildMethod(element);
-      } else if (kind === ElementKind.FIELD) {
+      } else if (identical(kind, ElementKind.FIELD)) {
         graph = builder.buildLazyInitializer(element);
       } else {
         compiler.internalErrorOnElement(element,
                                         'unexpected element kind $kind');
       }
       assert(graph.isValid());
-      if (kind !== ElementKind.FIELD) {
+      if (!identical(kind, ElementKind.FIELD)) {
         bool inLoop = functionsCalledInLoop.contains(element.declaration);
         if (!inLoop) {
           Selector selector = selectorsCalledInLoop[element.name];
-          inLoop = selector !== null && selector.applies(element, compiler);
+          inLoop = selector != null && selector.applies(element, compiler);
         }
         graph.calledInLoop = inLoop;
 
@@ -219,18 +219,22 @@
             defaultValueTypes.update(index, parameter.name, type);
             index++;
           });
+        } else {
+          // TODO(ahe): I have disabled type optimizations for
+          // optional arguments as the types are stored in the wrong
+          // order.
+          HTypeList parameterTypes =
+              backend.optimisticParameterTypes(element.declaration,
+                                               defaultValueTypes);
+          if (!parameterTypes.allUnknown) {
+            int i = 0;
+            signature.forEachParameter((Element param) {
+              builder.parameters[param].guaranteedType = parameterTypes[i++];
+            });
+          }
+          backend.registerParameterTypesOptimization(
+              element.declaration, parameterTypes, defaultValueTypes);
         }
-        HTypeList parameterTypes =
-            backend.optimisticParameterTypes(element.declaration,
-                                             defaultValueTypes);
-        if (!parameterTypes.allUnknown) {
-          int i = 0;
-          signature.orderedForEachParameter((Element param) {
-            builder.parameters[param].guaranteedType = parameterTypes[i++];
-          });
-        }
-        backend.registerParameterTypesOptimization(
-            element.declaration, parameterTypes, defaultValueTypes);
       }
 
       if (compiler.tracer.enabled) {
@@ -297,7 +301,7 @@
    * must be a boxed variable or a variable that is stored in a closure-field.
    */
   void redirectElement(Element from, Element to) {
-    assert(redirectionMapping[from] === null);
+    assert(redirectionMapping[from] == null);
     redirectionMapping[from] = to;
     assert(isStoredInClosureField(from) || isBoxed(from));
   }
@@ -320,7 +324,7 @@
     // See if any variable in the top-scope of the function is captured. If yes
     // we need to create a box-object.
     ClosureScope scopeData = closureData.capturingScopes[node];
-    if (scopeData !== null) {
+    if (scopeData != null) {
       // The scope has captured variables. Create a box.
       // TODO(floitsch): Clean up this hack. Should we create a box-object by
       // just creating an empty object literal?
@@ -419,9 +423,9 @@
   }
 
   bool hasValueForDirectLocal(Element element) {
-    assert(element !== null);
+    assert(element != null);
     assert(isAccessedDirectly(element));
-    return directLocals[element] !== null;
+    return directLocals[element] != null;
   }
 
   /**
@@ -429,13 +433,13 @@
    * captured variables that are stored in the closure-field return [false].
    */
   bool isAccessedDirectly(Element element) {
-    assert(element !== null);
-    return redirectionMapping[element] === null
+    assert(element != null);
+    return redirectionMapping[element] == null
         && !closureData.usedVariablesInTry.contains(element);
   }
 
   bool isStoredInClosureField(Element element) {
-    assert(element !== null);
+    assert(element != null);
     if (isAccessedDirectly(element)) return false;
     Element redirectTarget = redirectionMapping[element];
     if (redirectTarget == null) return false;
@@ -449,7 +453,7 @@
   bool isBoxed(Element element) {
     if (isAccessedDirectly(element)) return false;
     if (isStoredInClosureField(element)) return false;
-    return redirectionMapping[element] !== null;
+    return redirectionMapping[element] != null;
   }
 
   bool isUsedInTry(Element element) {
@@ -499,8 +503,8 @@
 
   HInstruction readThis() {
     HInstruction res = readLocal(closureData.thisElement);
-    if (res.guaranteedType === null) {
-      if (cachedTypeOfThis === null) {
+    if (res.guaranteedType == null) {
+      if (cachedTypeOfThis == null) {
         assert(closureData.isClosure());
         Element element = closureData.thisElement;
         ClassElement cls = element.enclosingElement.getEnclosingClass();
@@ -618,7 +622,7 @@
     saved.forEach((Element element, HInstruction instruction) {
       if (isAccessedDirectly(element)) {
         // We know 'this' cannot be modified.
-        if (element !== closureData.thisElement) {
+        if (!identical(element, closureData.thisElement)) {
           HPhi phi = new HPhi.singleInput(element, instruction);
           loopEntry.addPhi(phi);
           directLocals[element] = phi;
@@ -675,13 +679,13 @@
     Map<Element, HInstruction> joinedLocals = new Map<Element, HInstruction>();
     otherLocals.directLocals.forEach((element, instruction) {
       // We know 'this' cannot be modified.
-      if (element === closureData.thisElement) {
+      if (identical(element, closureData.thisElement)) {
         assert(directLocals[element] == instruction);
         joinedLocals[element] = instruction;
       } else {
         HInstruction mine = directLocals[element];
-        if (mine === null) return;
-        if (instruction === mine) {
+        if (mine == null) return;
+        if (identical(instruction, mine)) {
           joinedLocals[element] = instruction;
         } else {
           HInstruction phi =
@@ -707,7 +711,7 @@
     Map<Element, HInstruction> joinedLocals = new Map<Element,HInstruction>();
     HInstruction thisValue = null;
     directLocals.forEach((Element element, HInstruction instruction) {
-      if (element !== closureData.thisElement) {
+      if (!identical(element, closureData.thisElement)) {
         HPhi phi = new HPhi.noInputs(element);
         joinedLocals[element] = phi;
         joinBlock.addPhi(phi);
@@ -721,12 +725,12 @@
     for (LocalsHandler local in locals) {
       local.directLocals.forEach((Element element, HInstruction instruction) {
         HPhi phi = joinedLocals[element];
-        if (phi !== null) {
+        if (phi != null) {
           phi.addInput(instruction);
         }
       });
     }
-    if (thisValue !== null) {
+    if (thisValue != null) {
       // If there was a "this" for the scope, add it to the new locals.
       joinedLocals[closureData.thisElement] = thisValue;
     }
@@ -796,13 +800,13 @@
   TargetJumpHandler(SsaBuilder builder, this.target)
       : this.builder = builder,
         jumps = <JumpHandlerEntry>[] {
-    assert(builder.jumpTargets[target] === null);
+    assert(builder.jumpTargets[target] == null);
     builder.jumpTargets[target] = this;
   }
 
   void generateBreak([LabelElement label]) {
     HInstruction breakInstruction;
-    if (label === null) {
+    if (label == null) {
       breakInstruction = new HBreak(target);
     } else {
       breakInstruction = new HBreak.toLabel(label);
@@ -814,7 +818,7 @@
 
   void generateContinue([LabelElement label]) {
     HInstruction continueInstruction;
-    if (label === null) {
+    if (label == null) {
       continueInstruction = new HContinue(target);
     } else {
       continueInstruction = new HContinue.toLabel(label);
@@ -844,10 +848,10 @@
   List<LabelElement> labels() {
     List<LabelElement> result = null;
     for (LabelElement element in target.labels) {
-      if (result === null) result = <LabelElement>[];
+      if (result == null) result = <LabelElement>[];
       result.add(element);
     }
-    return (result === null) ? const <LabelElement>[] : result;
+    return (result == null) ? const <LabelElement>[] : result;
   }
 }
 
@@ -932,9 +936,9 @@
   HGraph buildMethod(FunctionElement functionElement) {
     assert(invariant(functionElement, functionElement.isImplementation));
     FunctionExpression function = functionElement.parseNode(compiler);
-    assert(function !== null);
+    assert(function != null);
     assert(!function.modifiers.isExternal());
-    assert(elements[function] !== null);
+    assert(elements[function] != null);
     openFunction(functionElement, function);
     function.body.accept(this);
     return closeFunction();
@@ -964,7 +968,7 @@
     if (constructor is SynthesizedConstructorElement) return null;
     FunctionExpression node = constructor.parseNode(compiler);
     // If we know the body doesn't have any code, we don't generate it.
-    if (node.body.asBlock() !== null) {
+    if (node.body.asBlock() != null) {
       NodeList statements = node.body.asBlock().statements;
       if (statements.isEmpty()) return null;
     }
@@ -982,7 +986,7 @@
         }
       }
     }
-    if (bodyElement === null) {
+    if (bodyElement == null) {
       bodyElement = new ConstructorBodyElement(constructor);
       // [:resolveMethodElement:] require the passed element to be a
       // declaration.
@@ -1035,7 +1039,7 @@
     localsHandler.updateLocal(returnElement,
                               graph.addConstantNull(constantSystem));
     elements = compiler.enqueuer.resolution.getCachedElements(function);
-    assert(elements !== null);
+    assert(elements != null);
     FunctionSignature signature = function.computeSignature(compiler);
     int index = 0;
     signature.orderedForEachParameter((Element parameter) {
@@ -1096,7 +1100,7 @@
     FunctionExpression functionExpression = function.parseNode(compiler);
     TreeElements newElements =
         compiler.enqueuer.resolution.getCachedElements(function);
-    if (newElements === null) {
+    if (newElements == null) {
       compiler.internalError("Element not resolved: $function");
     }
     if (!InlineWeeder.canBeInlined(functionExpression, newElements)) {
@@ -1181,7 +1185,7 @@
 
     bool foundSuperOrRedirect = false;
 
-    if (functionNode.initializers !== null) {
+    if (functionNode.initializers != null) {
       Link<Node> initializers = functionNode.initializers.nodes;
       for (Link<Node> link = initializers; !link.isEmpty(); link = link.tail) {
         assert(link.head is Send);
@@ -1215,13 +1219,13 @@
       ClassElement enclosingClass = constructor.getEnclosingClass();
       ClassElement superClass = enclosingClass.superclass;
       if (!enclosingClass.isObject(compiler)) {
-        assert(superClass !== null);
+        assert(superClass != null);
         assert(superClass.resolutionState == STATE_DONE);
         Selector selector =
             new Selector.callDefaultConstructor(enclosingClass.getLibrary());
         // TODO(johnniwinther): Should we find injected constructors as well?
         FunctionElement target = superClass.lookupConstructor(selector);
-        if (target === null) {
+        if (target == null) {
           compiler.internalError("no default constructor available");
         }
         inlineSuperOrRedirect(target.implementation,
@@ -1243,25 +1247,25 @@
                               Map<Element, HInstruction> fieldValues) {
     assert(invariant(classElement, classElement.isImplementation));
     classElement.forEachInstanceField(
+        (ClassElement enclosingClass, Element member) {
+          TreeElements definitions = compiler.analyzeElement(member);
+          Node node = member.parseNode(compiler);
+          SendSet assignment = node.asSendSet();
+          HInstruction value;
+          if (assignment === null) {
+            value = graph.addConstantNull(constantSystem);
+          } else {
+            Node right = assignment.arguments.head;
+            TreeElements savedElements = elements;
+            elements = definitions;
+            right.accept(this);
+            elements = savedElements;
+            value = pop();
+          }
+          fieldValues[member] = value;
+        },
         includeBackendMembers: true,
-        includeSuperMembers: false,
-        f: (ClassElement enclosingClass, Element member) {
-      TreeElements definitions = compiler.analyzeElement(member);
-      Node node = member.parseNode(compiler);
-      SendSet assignment = node.asSendSet();
-      HInstruction value;
-      if (assignment === null) {
-        value = graph.addConstantNull(constantSystem);
-      } else {
-        Node right = assignment.arguments.head;
-        TreeElements savedElements = elements;
-        elements = definitions;
-        right.accept(this);
-        elements = savedElements;
-        value = pop();
-      }
-      fieldValues[member] = value;
-    });
+        includeSuperMembers: false);
   }
 
 
@@ -1315,12 +1319,12 @@
     // Call the JavaScript constructor with the fields as argument.
     List<HInstruction> constructorArguments = <HInstruction>[];
     classElement.forEachInstanceField(
+        (ClassElement enclosingClass, Element member) {
+          constructorArguments.add(
+              potentiallyCheckType(fieldValues[member], member));
+        },
         includeBackendMembers: true,
-        includeSuperMembers: true,
-        f: (ClassElement enclosingClass, Element member) {
-      constructorArguments.add(
-          potentiallyCheckType(fieldValues[member], member));
-    });
+        includeSuperMembers: true);
 
     HForeignNew newObject = new HForeignNew(classElement, constructorArguments);
     add(newObject);
@@ -1340,7 +1344,7 @@
       FunctionElement constructor = constructors[index];
       assert(invariant(functionElement, constructor.isImplementation));
       ConstructorBodyElement body = getConstructorBody(constructor);
-      if (body === null) continue;
+      if (body == null) continue;
       List bodyCallInputs = <HInstruction>[];
       bodyCallInputs.add(newObject);
       FunctionSignature functionSignature = body.computeSignature(compiler);
@@ -1505,7 +1509,7 @@
   }
 
   bool isAborted() {
-    return current === null;
+    return current == null;
   }
 
   /**
@@ -1586,7 +1590,7 @@
 }
 
   void visit(Node node) {
-    if (node !== null) node.accept(this);
+    if (node != null) node.accept(this);
   }
 
   visitBlock(Block node) {
@@ -1662,12 +1666,12 @@
   }
 
   HSubGraphBlockInformation wrapStatementGraph(SubGraph statements) {
-    if (statements === null) return null;
+    if (statements == null) return null;
     return new HSubGraphBlockInformation(statements);
   }
 
   HSubExpressionBlockInformation wrapExpressionGraph(SubExpression expression) {
-    if (expression === null) return null;
+    if (expression == null) return null;
     return new HSubExpressionBlockInformation(expression);
   }
 
@@ -1693,7 +1697,7 @@
     // The initializer.
     SubExpression initializerGraph = null;
     HBasicBlock startBlock;
-    if (initialize !== null) {
+    if (initialize != null) {
       HBasicBlock initializerBlock = openNewBlock();
       startBlock = initializerBlock;
       initialize();
@@ -1705,7 +1709,7 @@
     JumpHandler jumpHandler = beginLoopHeader(loop);
     HLoopInformation loopInfo = current.loopInformation;
     HBasicBlock conditionBlock = current;
-    if (startBlock === null) startBlock = conditionBlock;
+    if (startBlock == null) startBlock = conditionBlock;
 
     HInstruction conditionInstruction = condition();
     HBasicBlock conditionExitBlock =
@@ -1754,7 +1758,7 @@
               jumpHandler.labels(),
               isContinue: true),
           updateBlock);
-    } else if (target !== null && target.isContinueTarget) {
+    } else if (target != null && target.isContinueTarget) {
       beginBodyBlock.setBlockFlow(
           new HLabeledBlockInformation.implicit(
               new HSubGraphBlockInformation(bodyGraph),
@@ -1791,19 +1795,19 @@
   }
 
   visitFor(For node) {
-    assert(node.body !== null);
+    assert(node.body != null);
     void buildInitializer() {
-      if (node.initializer === null) return;
+      if (node.initializer == null) return;
       Node initializer = node.initializer;
-      if (initializer !== null) {
+      if (initializer != null) {
         visit(initializer);
-        if (initializer.asExpression() !== null) {
+        if (initializer.asExpression() != null) {
           pop();
         }
       }
     }
     HInstruction buildCondition() {
-      if (node.condition === null) {
+      if (node.condition == null) {
         return graph.addConstantBool(true, constantSystem);
       }
       visit(node.condition);
@@ -1844,7 +1848,7 @@
     HBasicBlock loopEntryBlock = current;
     HBasicBlock bodyEntryBlock = current;
     TargetElement target = elements[node];
-    bool hasContinues = target !== null && target.isContinueTarget;
+    bool hasContinues = target != null && target.isContinueTarget;
     if (hasContinues) {
       // Add extra block to hang labels on.
       // It doesn't currently work if they are on the same block as the
@@ -1921,8 +1925,8 @@
   visitFunctionExpression(FunctionExpression node) {
     ClosureClassMap nestedClosureData =
         compiler.closureToClassMapper.getMappingForNestedFunction(node);
-    assert(nestedClosureData !== null);
-    assert(nestedClosureData.closureClassElement !== null);
+    assert(nestedClosureData != null);
+    assert(nestedClosureData.closureClassElement != null);
     ClassElement closureClassElement =
         nestedClosureData.closureClassElement;
     FunctionElement callElement = nestedClosureData.callElement;
@@ -2002,7 +2006,7 @@
     }
     assert(node.argumentsNode is Prefix);
     visit(node.receiver);
-    assert(op.token.kind !== PLUS_TOKEN);
+    assert(!identical(op.token.kind, PLUS_TOKEN));
     HInstruction operand = pop();
 
     HInstruction target =
@@ -2022,7 +2026,7 @@
       HConstant constant = operand;
       Constant folded =
           result.operation(constantSystem).fold(constant.constant);
-      if (folded !== null) {
+      if (folded != null) {
         stack.add(graph.addConstant(folded));
         return;
       }
@@ -2139,7 +2143,7 @@
     // TODO(kasperl): This is a convoluted way of checking if we're
     // generating code for a compound assignment. If we are, we need
     // to get the selector from the mapping for the AST selector node.
-    Selector selector = (send.asSendSet() === null)
+    Selector selector = (send.asSendSet() == null)
         ? elements.getSelector(send)
         : elements.getSelector(send.selector);
     assert(selector.isGetter());
@@ -2236,7 +2240,7 @@
         addWithPosition(new HStaticStore(element, value), send);
       }
       stack.add(value);
-    } else if (element === null || Elements.isInstanceField(element)) {
+    } else if (element == null || Elements.isInstanceField(element)) {
       HInstruction receiver = generateInstanceSendReceiver(send);
       generateInstanceSetterWithCompiledReceiver(send, receiver, value);
     } else if (Elements.isErroneousElement(element)) {
@@ -2247,11 +2251,11 @@
     } else {
       stack.add(value);
       // If the value does not already have a name, give it here.
-      if (value.sourceElement === null) {
+      if (value.sourceElement == null) {
         value.sourceElement = element;
       }
       HInstruction checked = potentiallyCheckType(value, element);
-      if (checked !== value) {
+      if (!identical(checked, value)) {
         pop();
         stack.add(checked);
       }
@@ -2341,7 +2345,7 @@
         stack.add(graph.addConstantBool(true, constantSystem));
       } else {
         HInstruction instruction;
-        if (typeInfo !== null) {
+        if (typeInfo != null) {
           instruction = new HIs.withTypeInfoCall(type, expression, typeInfo);
         } else {
           instruction = new HIs(type, expression);
@@ -2460,7 +2464,7 @@
           const SourceString('[]='), false);
     } else if (node.selector.asOperator() != null) {
       SourceString name = node.selector.asIdentifier().source;
-      isNotEquals = name.stringValue === '!=';
+      isNotEquals = identical(name.stringValue, '!=');
       dartMethodName = Elements.constructOperatorName(
           name, node.argumentsNode is Prefix);
     } else {
@@ -2468,7 +2472,7 @@
     }
 
     Element interceptor = null;
-    if (methodInterceptionEnabled && node.receiver !== null) {
+    if (methodInterceptionEnabled && node.receiver != null) {
       interceptor = interceptors.getStaticInterceptor(dartMethodName,
                                                       node.argumentCount());
     }
@@ -2483,7 +2487,7 @@
       return;
     }
 
-    if (node.receiver === null) {
+    if (node.receiver == null) {
       inputs.add(localsHandler.readThis());
     } else {
       visit(node.receiver);
@@ -2503,10 +2507,10 @@
 
   visitClosureSend(Send node) {
     Selector selector = elements.getSelector(node);
-    assert(node.receiver === null);
+    assert(node.receiver == null);
     Element element = elements[node];
     HInstruction closureTarget;
-    if (element === null) {
+    if (element == null) {
       visit(node.selector);
       closureTarget = pop();
     } else {
@@ -2598,7 +2602,7 @@
       // Leg's isolate.
       Element element = compiler.isolateLibrary.find(
           const SourceString('_currentIsolate'));
-      if (element === null) {
+      if (element == null) {
         compiler.cancel(
             'Isolate library and compiler mismatch', node: node);
       }
@@ -2618,7 +2622,7 @@
       // Call a helper method from the isolate library.
       Element element = compiler.isolateLibrary.find(
           const SourceString('_callInIsolate'));
-      if (element === null) {
+      if (element == null) {
         compiler.cancel(
             'Isolate library and compiler mismatch', node: node);
       }
@@ -2648,7 +2652,7 @@
     // signatures have different elements for parameters.
     FunctionElement implementation = function.implementation;
     FunctionSignature params = implementation.computeSignature(compiler);
-    if (params.optionalParameterCount !== 0) {
+    if (params.optionalParameterCount != 0) {
       compiler.cancel(
           'JS_TO_CLOSURE does not handle closure with optional parameters',
           node: closure);
@@ -2704,7 +2708,7 @@
 
   visitSend(Send node) {
     Element element = elements[node];
-    if (element !== null && element === work.element) {
+    if (element != null && identical(element, work.element)) {
       graph.isRecursiveMethod = true;
     }
     super.visitSend(node);
@@ -2713,7 +2717,7 @@
   visitSuperSend(Send node) {
     Selector selector = elements.getSelector(node);
     Element element = elements[node];
-    if (element === null) return generateSuperNoSuchMethodSend(node);
+    if (element == null) return generateSuperNoSuchMethodSend(node);
     // TODO(5346): Try to avoid the need for calling [declaration] before
     // creating an [HStatic].
     HInstruction target = new HStatic(element.declaration);
@@ -2731,7 +2735,7 @@
       if (!succeeded) {
         // TODO(ngeoffray): Match the VM behavior and throw an
         // exception at runtime.
-        compiler.cancel('Unimplemented non-matching static call', node);
+        compiler.cancel('Unimplemented non-matching static call', node: node);
       }
       push(new HInvokeSuper(inputs));
     } else {
@@ -2898,7 +2902,7 @@
     bool isListConstructor = false;
     computeType(element) {
       Element originalElement = elements[node];
-      if (originalElement.getEnclosingClass() === compiler.listClass) {
+      if (identical(originalElement.getEnclosingClass(), compiler.listClass)) {
         isListConstructor = true;
         if (node.arguments.isEmpty()) {
           return HType.EXTENDABLE_ARRAY;
@@ -2915,7 +2919,7 @@
 
     Element constructor = elements[node];
     Selector selector = elements.getSelector(node);
-    if (compiler.enqueuer.resolution.getCachedElements(constructor) === null) {
+    if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) {
       compiler.internalError("Unresolved element: $constructor", node: node);
     }
     FunctionElement functionElement = constructor;
@@ -2973,7 +2977,7 @@
       generateThrowNoSuchMethod(node, getTargetName(element), node.arguments);
       return;
     }
-    if (element === compiler.assertMethod && !compiler.enableUserAssertions) {
+    if (identical(element, compiler.assertMethod) && !compiler.enableUserAssertions) {
       stack.add(graph.addConstantNull(constantSystem));
       return;
     }
@@ -2996,6 +3000,14 @@
         // exception at runtime.
         compiler.cancel('Unimplemented non-matching static call', node: node);
       }
+
+      // TODO(kasperl): Try to use the general inlining infrastructure for
+      // inlining the identical function.
+      if (identical(element, compiler.identicalFunction)) {
+        pushWithPosition(new HIdentity(target, inputs[1], inputs[2]), node);
+        return;
+      }
+
       HInvokeStatic instruction = new HInvokeStatic(inputs);
       // TODO(ngeoffray): Only do this if knowing the return type is
       // useful.
@@ -3017,7 +3029,7 @@
   }
 
   // TODO(antonm): migrate rest of SsaBuilder to internalError.
-  internalError(String reason, [Node node]) {
+  internalError(String reason, {Node node}) {
     compiler.internalError(reason, node: node);
   }
 
@@ -3094,20 +3106,20 @@
     Operator op = node.assignmentOperator;
     if (node.isSuperCall) {
       Element element = elements[node];
-      if (element === null) return generateSuperNoSuchMethodSend(node);
+      if (element == null) return generateSuperNoSuchMethodSend(node);
       HInstruction target = new HStatic(element);
       HInstruction context = localsHandler.readThis();
       add(target);
       var inputs = <HInstruction>[target, context];
       addDynamicSendArgumentsToList(node, inputs);
-      if (node.assignmentOperator.source.stringValue !== '=') {
+      if (!identical(node.assignmentOperator.source.stringValue, '=')) {
         compiler.unimplemented('complex super assignment',
                                node: node.assignmentOperator);
       }
       push(new HInvokeSuper(inputs, isSetter: true));
     } else if (node.isIndex) {
       if (!methodInterceptionEnabled) {
-        assert(op.source.stringValue === '=');
+        assert(identical(op.source.stringValue, '='));
         visitDynamicSend(node);
       } else {
         HStatic target = new HStatic(
@@ -3159,7 +3171,7 @@
       visit(link.head);
       HInstruction value = pop();
       generateSetter(node, element, value);
-    } else if (op.source.stringValue === "is") {
+    } else if (identical(op.source.stringValue, "is")) {
       compiler.internalError("is-operator as SendSet", node: op);
     } else {
       assert(const SourceString("++") == op.source ||
@@ -3187,12 +3199,12 @@
       }
       visitBinary(left, op, right);
       HInstruction operation = pop();
-      assert(operation !== null);
+      assert(operation != null);
       if (Elements.isInstanceSend(node, elements)) {
-        assert(receiver !== null);
+        assert(receiver != null);
         generateInstanceSetterWithCompiledReceiver(node, receiver, operation);
       } else {
-        assert(receiver === null);
+        assert(receiver == null);
         generateSetter(node, element, operation);
       }
       if (!isPrefix) {
@@ -3264,12 +3276,16 @@
   }
 
   visitReturn(Return node) {
-    if (node.getBeginToken().stringValue === 'native') {
+    if (identical(node.getBeginToken().stringValue, 'native')) {
       native.handleSsaNative(this, node.expression);
       return;
     }
+    if (node.isRedirectingFactoryBody) {
+      compiler.internalError("Unimplemented: Redirecting factory constructor",
+                             node: node);
+    }
     HInstruction value;
-    if (node.expression === null) {
+    if (node.expression == null) {
       value = graph.addConstantNull(constantSystem);
     } else {
       visit(node.expression);
@@ -3283,9 +3299,9 @@
   }
 
   visitThrow(Throw node) {
-    if (node.expression === null) {
+    if (node.expression == null) {
       HInstruction exception = rethrowableException;
-      if (exception === null) {
+      if (exception == null) {
         exception = graph.addConstantNull(constantSystem);
         compiler.internalError(
             'rethrowableException should not be null', node: node);
@@ -3337,8 +3353,7 @@
   }
 
   visitConditional(Conditional node) {
-    SsaBranchBuilder brancher =
-        new SsaBranchBuilder(this, diagnosticNode: node);
+    SsaBranchBuilder brancher = new SsaBranchBuilder(this, node);
     brancher.handleConditional(() => visit(node.condition),
                                () => visit(node.thenExpression),
                                () => visit(node.elseExpression));
@@ -3367,10 +3382,10 @@
   visitBreakStatement(BreakStatement node) {
     assert(!isAborted());
     TargetElement target = elements[node];
-    assert(target !== null);
+    assert(target != null);
     JumpHandler handler = jumpTargets[target];
-    assert(handler !== null);
-    if (node.target === null) {
+    assert(handler != null);
+    if (node.target == null) {
       handler.generateBreak();
     } else {
       LabelElement label = elements[node.target];
@@ -3380,14 +3395,14 @@
 
   visitContinueStatement(ContinueStatement node) {
     TargetElement target = elements[node];
-    assert(target !== null);
+    assert(target != null);
     JumpHandler handler = jumpTargets[target];
-    assert(handler !== null);
-    if (node.target === null) {
+    assert(handler != null);
+    if (node.target == null) {
       handler.generateContinue();
     } else {
       LabelElement label = elements[node.target];
-      assert(label !== null);
+      assert(label != null);
       handler.generateContinue(label);
     }
   }
@@ -3399,7 +3414,7 @@
    */
   JumpHandler createJumpHandler(Statement node) {
     TargetElement element = elements[node];
-    if (element === null || element.statement !== node) {
+    if (element == null || !identical(element.statement, node)) {
       // No breaks or continues to this node.
       return new NullJumpHandler(compiler);
     }
@@ -3436,10 +3451,10 @@
       push(new HInvokeDynamicMethod(call, <HInstruction>[iterator]));
 
       Element variable;
-      if (node.declaredIdentifier.asSend() !== null) {
+      if (node.declaredIdentifier.asSend() != null) {
         variable = elements[node.declaredIdentifier];
       } else {
-        assert(node.declaredIdentifier.asVariableDefinitions() !== null);
+        assert(node.declaredIdentifier.asVariableDefinitions() != null);
         VariableDefinitions variableDefinitions = node.declaredIdentifier;
         variable = elements[variableDefinitions.definitions.nodes.head];
       }
@@ -3447,7 +3462,7 @@
       if (variable.isErroneous()) {
         generateThrowNoSuchMethod(node,
                                   getTargetName(variable, 'set'),
-                                  argumentValues: <HInstruction>[oldVariable]);
+                                  <HInstruction>[oldVariable]);
         pop();
       } else {
         localsHandler.updateLocal(variable, oldVariable);
@@ -3471,7 +3486,7 @@
     }
     // Non-loop statements can only be break targets, not continue targets.
     TargetElement targetElement = elements[body];
-    if (targetElement === null || targetElement.statement !== body) {
+    if (targetElement == null || !identical(targetElement.statement, body)) {
       // Labeled statements with no element on the body have no breaks.
       // A different target statement only happens if the body is itself
       // a break or continue for a different target. In that case, this
@@ -3607,7 +3622,7 @@
           Constant constant =
             compiler.constantHandler.tryCompileNodeWithDefinitions(
                 match.expression, elements);
-          if (constant === null) {
+          if (constant == null) {
             compiler.reportWarning(match.expression,
                 MessageKind.NOT_A_COMPILE_TIME_CONSTANT.error());
             failure = true;
@@ -3763,7 +3778,7 @@
 
     ConstructedConstant constructedConstant = constant;
     DartType type = constructedConstant.type;
-    assert(type !== null);
+    assert(type != null);
     Element element = type.element;
     // If the type is not a class, we'll just assume it overrides
     // operator==. Typedefs do, since [Function] does.
@@ -3845,7 +3860,7 @@
         Constant constant =
             compiler.constantHandler.tryCompileNodeWithDefinitions(
                 match.expression, elements);
-        if (constant !== null) {
+        if (constant != null) {
           stack.add(graph.addConstant(constant));
         } else {
           visit(match.expression);
@@ -3980,7 +3995,7 @@
       void visitThen() {
         CatchBlock catchBlock = link.head;
         link = link.tail;
-        if (catchBlock.exception !== null) {
+        if (catchBlock.exception != null) {
           localsHandler.updateLocal(elements[catchBlock.exception],
                                     unwrappedException);
         }
@@ -4139,7 +4154,7 @@
   void visitExpression(Node node) {
     node.accept(builder);
     HInstruction expression = builder.pop();
-    result = (result === null) ? expression : concat(result, expression);
+    result = (result == null) ? expression : concat(result, expression);
   }
 
   void visitStringInterpolation(StringInterpolation node) {
@@ -4219,7 +4234,7 @@
   }
 
   void visitReturn(Node node) {
-    if (seenReturn || node.getBeginToken().stringValue === 'native') {
+    if (seenReturn || identical(node.getBeginToken().stringValue, 'native')) {
       tooDifficult = true;
       return;
     }
@@ -4286,7 +4301,7 @@
     startBranch(conditionBranch);
     visitCondition();
     checkNotAborted();
-    assert(builder.current === builder.lastOpenedBlock);
+    assert(identical(builder.current, builder.lastOpenedBlock));
     HInstruction conditionValue = builder.popBoolified();
     HIf branch = new HIf(conditionValue);
     HBasicBlock conditionExitBlock = builder.current;
@@ -4308,7 +4323,7 @@
    * return value implies that [mayReuseFromLocals] was set to [:true:].
    */
   bool mergeLocals(SsaBranch fromBranch, SsaBranch toBranch,
-                   [bool mayReuseFromLocals]) {
+                   {bool mayReuseFromLocals}) {
     LocalsHandler fromLocals = fromBranch.exitLocals;
     if (toBranch.startLocals == null) {
       if (mayReuseFromLocals) {
@@ -4367,7 +4382,7 @@
     _handleDiamondBranch(visitCondition, visitThen, visitElse, true);
   }
 
-  void handleLogicalAndOr(void left(), void right(), [bool isAnd]) {
+  void handleLogicalAndOr(void left(), void right(), {bool isAnd}) {
     // x && y is transformed into:
     //   t0 = boolify(x);
     //   if (t0) {
@@ -4409,7 +4424,7 @@
 
   void handleLogicalAndOrWithLeftNode(Node left,
                                       void visitRight(),
-                                      [bool isAnd]) {
+                                      {bool isAnd}) {
     // This method is similar to [handleLogicalAndOr] but optimizes the case
     // where left is a logical "and" or logical "or".
     //
@@ -4425,7 +4440,7 @@
     //   result = phi(t3, false);
 
     Send send = left.asSend();
-    if (send !== null &&
+    if (send != null &&
         (isAnd ? send.isLogicalAnd : send.isLogicalOr)) {
       Node newLeft = send.receiver;
       Link<Node> link = send.argumentsNode.nodes;
@@ -4433,10 +4448,11 @@
       Node middle = link.head;
       handleLogicalAndOrWithLeftNode(
           newLeft,
-          () => handleLogicalAndOrWithLeftNode(middle, visitRight, isAnd),
+          () => handleLogicalAndOrWithLeftNode(middle, visitRight,
+                                               isAnd: isAnd),
           isAnd: isAnd);
     } else {
-      handleLogicalAndOr(() => builder.visit(left), visitRight, isAnd);
+      handleLogicalAndOr(() => builder.visit(left), visitRight, isAnd: isAnd);
     }
   }
 
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index b4e06b3..d8cda34 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -477,7 +477,7 @@
           basicBlock = basicBlock.successors[0];
         } else {
           // We allow an expression to end on an HIf (a condition expression).
-          return basicBlock === limits.end ? result : TYPE_STATEMENT;
+          return identical(basicBlock, limits.end) ? result : TYPE_STATEMENT;
         }
       } else {
         // Expression-incompatible control flow.
@@ -488,17 +488,17 @@
   }
 
   bool isJSExpression(HExpressionInformation info) {
-    return expressionType(info) !== TYPE_STATEMENT;
+    return !identical(expressionType(info), TYPE_STATEMENT);
   }
 
   bool isJSDeclaration(HExpressionInformation info) {
-    return expressionType(info) === TYPE_DECLARATION;
+    return identical(expressionType(info), TYPE_DECLARATION);
   }
 
   bool isJSCondition(HExpressionInformation info) {
     HSubExpressionBlockInformation graph = info;
     SubExpression limits = graph.subExpression;
-    return expressionType(info) !== TYPE_STATEMENT &&
+    return !identical(expressionType(info), TYPE_STATEMENT) &&
        (limits.end.last is HConditionalBranch);
   }
 
@@ -775,7 +775,7 @@
     js.Block body = generateStatementsInNewBlock(info.body);
     js.Catch catchPart = null;
     js.Block finallyPart = null;
-    if (info.catchBlock !== null) {
+    if (info.catchBlock != null) {
       HParameterValue exception = info.catchVariable;
       String name = variableNames.getName(exception);
       parameterNames[exception.sourceElement] = name;
@@ -814,7 +814,7 @@
       case HLoopBlockInformation.FOR_IN_LOOP:
         HBlockInformation initialization = info.initializer;
         int initializationType = TYPE_STATEMENT;
-        if (initialization !== null) {
+        if (initialization != null) {
           initializationType = expressionType(initialization);
           if (initializationType == TYPE_STATEMENT) {
             generateStatements(initialization);
@@ -822,11 +822,11 @@
           }
         }
         if (isConditionExpression &&
-            info.updates !== null && isJSExpression(info.updates)) {
+            info.updates != null && isJSExpression(info.updates)) {
           // If we have an updates graph, and it's expressible as an
           // expression, generate a for-loop.
           js.Expression jsInitialization = null;
-          if (initialization !== null) {
+          if (initialization != null) {
             int delayedVariablesCount = delayedVariableDeclarations.length;
             jsInitialization = generateExpression(initialization);
             if (delayedVariablesCount < delayedVariableDeclarations.length) {
@@ -884,7 +884,7 @@
         } else {
           // We have either no update graph, or it's too complex to
           // put in an expression.
-          if (initialization !== null) {
+          if (initialization != null) {
             generateStatements(initialization);
           }
           js.Expression jsCondition;
@@ -902,7 +902,7 @@
             js.Break jsBreak = new js.Break(null);
             pushStatement(new js.If.noElse(ifTest, jsBreak));
           }
-          if (info.updates !== null) {
+          if (info.updates != null) {
             wrapLoopBodyForContinue(info);
             generateStatements(info.updates);
           } else {
@@ -915,18 +915,18 @@
         break;
       case HLoopBlockInformation.DO_WHILE_LOOP:
         // Generate do-while loop in all cases.
-        if (info.initializer !== null) {
+        if (info.initializer != null) {
           generateStatements(info.initializer);
         }
         js.Block oldContainer = currentContainer;
         js.Statement body = new js.Block.empty();
         currentContainer = body;
-        if (!isConditionExpression || info.updates !== null) {
+        if (!isConditionExpression || info.updates != null) {
           wrapLoopBodyForContinue(info);
         } else {
           visitBodyIgnoreLabels(info);
         }
-        if (info.updates !== null) {
+        if (info.updates != null) {
           generateStatements(info.updates);
         }
         if (isConditionExpression) {
@@ -1022,7 +1022,7 @@
   // to (if necessary).
   void wrapLoopBodyForContinue(HLoopBlockInformation info) {
     TargetElement target = info.target;
-    if (target !== null && target.isContinueTarget) {
+    if (target != null && target.isContinueTarget) {
       js.Block oldContainer = currentContainer;
       js.Block body = new js.Block.empty();
       currentContainer = body;
@@ -1060,7 +1060,7 @@
     // When the structure graph is complete, we will be able to have
     // different structures starting on the same basic block (e.g., an
     // "if" and its condition).
-    if (info === currentBlockInformation) return false;
+    if (identical(info, currentBlockInformation)) return false;
 
     HBlockInformation oldBlockInformation = currentBlockInformation;
     currentBlockInformation = info;
@@ -1068,7 +1068,7 @@
     currentBlockInformation = oldBlockInformation;
     if (success) {
       HBasicBlock continuation = block.continuation;
-      if (continuation !== null) {
+      if (continuation != null) {
         visitBasicBlock(continuation);
       }
     }
@@ -1082,13 +1082,13 @@
     currentBlock = node;
     // If this node has block-structure based information attached,
     // try using that to traverse from here.
-    if (node.blockFlow !== null &&
+    if (node.blockFlow != null &&
         handleBlockFlow(node.blockFlow)) {
       return;
     }
     // Flow based traversal.
     if (node.isLoopHeader() &&
-        node.loopInformation.loopBlockInformation !== currentBlockInformation) {
+        !identical(node.loopInformation.loopBlockInformation, currentBlockInformation)) {
       beginLoop(node);
     }
     iterateBasicBlock(node);
@@ -1141,7 +1141,7 @@
     // For each copy, if the destination does not have a current
     // location, then we can safely assign to it.
     for (Copy copy in copies) {
-      if (currentLocation[copy.destination] === null) {
+      if (currentLocation[copy.destination] == null) {
         ready.add(copy.destination);
       }
     }
@@ -1159,7 +1159,7 @@
         // If [source] hasn't been updated and needs to have a value,
         // add it to the list of variables that can be updated. Copies
         // of [source] will now use [destination].
-        if (source == copy && initialValue[source] !== null) {
+        if (source == copy && initialValue[source] != null) {
           ready.add(source);
         }
       }
@@ -1169,7 +1169,7 @@
       // If [current] is used as a source, and the assignment has been
       // done, we are done with this variable. Otherwise there is a
       // cycle that we break by using a temporary name.
-      if (currentLocation[current] !== null
+      if (currentLocation[current] != null
           && current != currentLocation[initialValue[current]]) {
         String tempName = variableNames.swapTemp;
         emitAssignment(tempName, current);
@@ -1196,7 +1196,7 @@
 
   void iterateBasicBlock(HBasicBlock node) {
     HInstruction instruction = node.first;
-    while (instruction !== node.last) {
+    while (!identical(instruction, node.last)) {
       if (instruction is HTypeGuard || instruction is HBailoutTarget) {
         visit(instruction);
       } else if (!isGenerateAtUseSite(instruction)) {
@@ -1328,7 +1328,7 @@
       compiler.internalError('dominated.length = ${dominated.length}',
                              instruction: node);
     }
-    if (dominated.length == 2 && currentBlock !== currentGraph.entry) {
+    if (dominated.length == 2 && !identical(currentBlock, currentGraph.entry)) {
       compiler.internalError('currentBlock !== currentGraph.entry',
                              instruction: node);
     }
@@ -1343,14 +1343,14 @@
    */
   bool tryCallAction(Map<Element, ElementAction> map, Element element) {
     ElementAction action = map[element];
-    if (action === null) return false;
+    if (action == null) return false;
     action(element);
     return true;
   }
 
   visitBreak(HBreak node) {
     assert(currentBlock.successors.length == 1);
-    if (node.label !== null) {
+    if (node.label != null) {
       LabelElement label = node.label;
       if (!tryCallAction(breakAction, label)) {
         pushStatement(new js.Break(backend.namer.breakLabelName(label)), node);
@@ -1365,7 +1365,7 @@
 
   visitContinue(HContinue node) {
     assert(currentBlock.successors.length == 1);
-    if (node.label !== null) {
+    if (node.label != null) {
       LabelElement label = node.label;
       if (!tryCallAction(continueAction, label)) {
         // TODO(floitsch): should this really be the breakLabelName?
@@ -1438,7 +1438,7 @@
     }
 
     HBasicBlock joinBlock = node.joinBlock;
-    if (joinBlock !== null && joinBlock.dominator !== node.block) {
+    if (joinBlock != null && !identical(joinBlock.dominator, node.block)) {
       // The join block is dominated by a block in one of the branches.
       // The subgraph traversal never reached it, so we visit it here
       // instead.
@@ -1479,7 +1479,7 @@
       methodName = backend.namer.instanceMethodInvocationName(
           node.selector.library, name, node.selector);
       arguments = visitArguments(node.inputs);
-      bool inLoop = node.block.enclosingLoopHeader !== null;
+      bool inLoop = node.block.enclosingLoopHeader != null;
 
       // Register this invocation to collect the types used at all call sites.
       Selector selector = getOptimizedSelectorFor(node, node.selector);
@@ -1488,7 +1488,7 @@
       // If we don't know what we're calling or if we are calling a getter,
       // we need to register that fact that we may be calling a closure
       // with the same arguments.
-      if (target === null || target.isGetter()) {
+      if (target == null || target.isGetter()) {
         // TODO(kasperl): If we have a typed selector for the call, we
         // may know something about the types of closures that need
         // the specific closure call method.
@@ -1496,7 +1496,7 @@
         world.registerDynamicInvocation(call.name, call);
       }
 
-      if (target !== null) {
+      if (target != null) {
         // If we know we're calling a specific method, register that
         // method only.
         if (inLoop) backend.builder.functionsCalledInLoop.add(target);
@@ -1515,7 +1515,7 @@
     if (defaultSelector.name.isPrivate()) return defaultSelector;
     HType receiverHType = types[node.inputs[0]];
     DartType receiverType = receiverHType.computeType(compiler);
-    if (receiverType !== null) {
+    if (receiverType != null) {
       return new TypedSelector(receiverType, defaultSelector);
     } else {
       return defaultSelector;
@@ -1750,7 +1750,7 @@
   }
 
   visitLoopBranch(HLoopBranch node) {
-    if (subGraph !== null && node.block === subGraph.end) {
+    if (subGraph != null && identical(node.block, subGraph.end)) {
       // We are generating code for a loop condition.
       // If doing this as part of a SubGraph traversal, the
       // calling code will handle the control flow logic.
@@ -1775,7 +1775,7 @@
 
     // If the branch does not dominate the code after the loop, the
     // dominator will visit it.
-    if (branchBlock.successors[1].dominator !== branchBlock) return;
+    if (!identical(branchBlock.successors[1].dominator, branchBlock)) return;
 
     visitBasicBlock(branchBlock.successors[1]);
     // With labeled breaks we can have more dominated blocks.
@@ -1980,13 +1980,13 @@
     node.usedBy.forEach((HInstruction instr) {
       if (instr is !HInvokeStatic) {
         backend.registerNonCallStaticUse(node);
-      } else if (instr.target !== node) {
+      } else if (!identical(instr.target, node)) {
         backend.registerNonCallStaticUse(node);
       } else {
         // If invoking the static is can still be passed as an argument as well
         // which will also be non call static use.
         for (int i = 1; i < node.inputs.length; i++) {
-          if (node.inputs === node) {
+          if (identical(node.inputs, node)) {
             backend.registerNonCallStaticUse(node);
             break;
           }
@@ -2119,7 +2119,7 @@
 
   void visitInvokeInterceptor(HInvokeInterceptor node) {
     String builtin = builtinJsName(node);
-    if (builtin !== null) {
+    if (builtin != null) {
       if (builtin == '+') {
         use(node.inputs[1]);
         js.Expression left = pop();
@@ -2157,7 +2157,7 @@
     js.Expression left = pop();
     use(input);
     js.Expression right = pop();
-    // TODO(4984): Deal with infinity.
+    // TODO(4984): Deal with infinity and -0.0.
     push(new js.LiteralExpression.withData('Math.floor(#) === #',
                                            <js.Expression>[left, right]));
   }
@@ -2239,7 +2239,7 @@
                        new js.Binary('&&', objectTest, pop())));
   }
 
-  void checkType(HInstruction input, DartType type, [bool negative = false]) {
+  void checkType(HInstruction input, DartType type, {bool negative: false}) {
     world.registerIsCheck(type);
     Element element = type.element;
     use(input);
@@ -2257,7 +2257,7 @@
   }
 
   void handleNumberOrStringSupertypeCheck(HInstruction input, DartType type) {
-    assert(type.element !== compiler.listClass
+    assert(!identical(type.element, compiler.listClass)
            && !Elements.isListSupertype(type.element, compiler)
            && !Elements.isStringOnlySupertype(type.element, compiler));
     checkNum(input, '===');
@@ -2273,7 +2273,7 @@
   }
 
   void handleStringSupertypeCheck(HInstruction input, DartType type) {
-    assert(type.element !== compiler.listClass
+    assert(!identical(type.element, compiler.listClass)
            && !Elements.isListSupertype(type.element, compiler)
            && !Elements.isNumberOrStringSupertype(type.element, compiler));
     checkString(input, '===');
@@ -2287,7 +2287,7 @@
   }
 
   void handleListOrSupertypeCheck(HInstruction input, DartType type) {
-    assert(type.element !== compiler.stringClass
+    assert(!identical(type.element, compiler.stringClass)
            && !Elements.isStringOnlySupertype(type.element, compiler)
            && !Elements.isNumberOrStringSupertype(type.element, compiler));
     checkObject(input, '===');
@@ -2304,16 +2304,16 @@
     DartType type = node.typeExpression;
     world.registerIsCheck(type);
     Element element = type.element;
-    if (element.kind === ElementKind.TYPE_VARIABLE) {
+    if (identical(element.kind, ElementKind.TYPE_VARIABLE)) {
       compiler.unimplemented("visitIs for type variables", instruction: node);
-    } else if (element.kind === ElementKind.TYPEDEF) {
+    } else if (identical(element.kind, ElementKind.TYPEDEF)) {
       compiler.unimplemented("visitIs for typedefs", instruction: node);
     }
     LibraryElement coreLibrary = compiler.coreLibrary;
     ClassElement objectClass = compiler.objectClass;
     HInstruction input = node.expression;
 
-    if (element === objectClass || element === compiler.dynamicClass) {
+    if (identical(element, objectClass) || identical(element, compiler.dynamicClass)) {
       // The constant folder also does this optimization, but we make
       // it safe by assuming it may have not run.
       push(new js.LiteralBool(true), node);
@@ -2346,7 +2346,7 @@
     } else if (Elements.isStringOnlySupertype(element, compiler)) {
       handleStringSupertypeCheck(input, type);
       attachLocationToLast(node);
-    } else if (element === compiler.listClass
+    } else if (identical(element, compiler.listClass)
                || Elements.isListSupertype(element, compiler)) {
       handleListOrSupertypeCheck(input, type);
       attachLocationToLast(node);
@@ -2487,7 +2487,7 @@
   void endGraph(HGraph graph) {}
 
   js.Statement bailout(HTypeGuard guard, String reason) {
-    if (maxBailoutParameters === null) {
+    if (maxBailoutParameters == null) {
       maxBailoutParameters = 0;
       work.guards.forEach((HTypeGuard workGuard) {
         HBailoutTarget target = workGuard.bailoutTarget;
@@ -2872,7 +2872,7 @@
     if (block.hasBailoutTargets()) {
       startBailoutSwitch();
       HLoopInformation loopInformation = block.loopInformation;
-      if (loopInformation.target !== null) {
+      if (loopInformation.target != null) {
         breakAction[loopInformation.target] = (TargetElement target) {
           pushStatement(new js.Break(loopLabel));
         };
diff --git a/lib/compiler/implementation/ssa/codegen_helpers.dart b/lib/compiler/implementation/ssa/codegen_helpers.dart
index 19e177c..611dcf1 100644
--- a/lib/compiler/implementation/ssa/codegen_helpers.dart
+++ b/lib/compiler/implementation/ssa/codegen_helpers.dart
@@ -106,8 +106,8 @@
   }
 
   bool isBlockSinglePredecessor(HBasicBlock block) {
-    return block.successors.length === 1
-        && block.successors[0].predecessors.length === 1;
+    return block.successors.length == 1
+        && block.successors[0].predecessors.length == 1;
   }
 
   void visitBasicBlock(HBasicBlock block) {
@@ -127,7 +127,7 @@
 
     // The expectedInputs list holds non-trivial instructions that may
     // be generated at their use site, if they occur in the correct order.
-    if (expectedInputs === null) expectedInputs = new List<HInstruction>();
+    if (expectedInputs == null) expectedInputs = new List<HInstruction>();
 
     // Pop instructions from expectedInputs until instruction is found.
     // Return true if it is found, or false if not.
@@ -136,7 +136,7 @@
         HInstruction nextInput = expectedInputs.removeLast();
         assert(!generateAtUseSite.contains(nextInput));
         assert(nextInput.usedBy.length == 1);
-        if (nextInput === instruction) {
+        if (identical(nextInput, instruction)) {
           return true;
         }
       }
@@ -145,7 +145,7 @@
 
     block.last.accept(this);
     for (HInstruction instruction = block.last.previous;
-         instruction !== null;
+         instruction != null;
          instruction = instruction.previous) {
       if (generateAtUseSite.contains(instruction)) {
         continue;
@@ -167,7 +167,7 @@
       instruction.accept(this);
     }
 
-    if (block.predecessors.length === 1
+    if (block.predecessors.length == 1
         && isBlockSinglePredecessor(block.predecessors[0])) {
       assert(block.phis.isEmpty());
       tryMergingExpressions(block.predecessors[0]);
@@ -207,13 +207,13 @@
   bool hasAnyStatement(HBasicBlock block, HInstruction instruction) {
     // If [instruction] is not in [block], then if the block is not
     // empty, we know there will be a statement to emit.
-    if (instruction.block !== block) return block.last !== block.first;
+    if (!identical(instruction.block, block)) return !identical(block.last, block.first);
 
     // If [instruction] is not the last instruction of the block
     // before the control flow instruction, or the last instruction,
     // then we will have to emit a statement for that last instruction.
     if (instruction != block.last
-        && instruction !== block.last.previous) return true;
+        && !identical(instruction, block.last.previous)) return true;
 
     // If one of the instructions in the block until [instruction] is
     // not generated at use site, then we will have to emit a
@@ -221,7 +221,7 @@
     // TODO(ngeoffray): we could generate a comma separated
     // list of expressions.
     for (HInstruction temp = block.first;
-         temp !== instruction;
+         !identical(temp, instruction);
          temp = temp.next) {
       if (!generateAtUseSite.contains(temp)) return true;
     }
@@ -277,10 +277,10 @@
 
     if (end == null) return;
     if (end.phis.isEmpty()) return;
-    if (end.phis.first !== end.phis.last) return;
+    if (!identical(end.phis.first, end.phis.last)) return;
     HBasicBlock elseBlock = startIf.elseBlock;
 
-    if (end.predecessors[1] !== elseBlock) return;
+    if (!identical(end.predecessors[1], elseBlock)) return;
     HPhi phi = end.phis.first;
     HInstruction thenInput = phi.inputs[0];
     HInstruction elseInput = phi.inputs[1];
@@ -302,21 +302,21 @@
     // sequence of control flow operation.
     if (controlFlowOperators.contains(thenBlock.last)) {
       HIf otherIf = thenBlock.last;
-      if (otherIf.joinBlock !== end) {
+      if (!identical(otherIf.joinBlock, end)) {
         // This could be a join block that just feeds into our join block.
         HBasicBlock otherJoin = otherIf.joinBlock;
         if (otherJoin.first != otherJoin.last) return;
         if (otherJoin.successors.length != 1) return;
         if (otherJoin.successors[0] != end) return;
         if (otherJoin.phis.isEmpty()) return;
-        if (otherJoin.phis.first !== otherJoin.phis.last) return;
+        if (!identical(otherJoin.phis.first, otherJoin.phis.last)) return;
         HPhi otherPhi = otherJoin.phis.first;
         if (thenInput != otherPhi) return;
         if (elseInput != otherPhi.inputs[1]) return;
       }
       if (hasAnyStatement(thenBlock, otherIf)) return;
     } else {
-      if (end.predecessors[0] !== thenBlock) return;
+      if (!identical(end.predecessors[0], thenBlock)) return;
       if (hasAnyStatement(thenBlock, thenInput)) return;
       assert(thenBlock.successors.length == 1);
     }
@@ -329,19 +329,19 @@
     // of its block and is safe to be generated at use site, mark it
     // so.
     if (phi.usedBy.length == 1
-        && phi.usedBy[0] === phi.block.first
+        && identical(phi.usedBy[0], phi.block.first)
         && isSafeToGenerateAtUseSite(phi.usedBy[0], phi)) {
       markAsGenerateAtUseSite(phi);
     }
 
-    if (elseInput.block === elseBlock) {
+    if (identical(elseInput.block, elseBlock)) {
       assert(elseInput.usedBy.length == 1);
       markAsGenerateAtUseSite(elseInput);
     }
 
     // If [thenInput] is defined in the first predecessor, then it is only used
     // by [phi] and can be generated at use site.
-    if (thenInput.block === end.predecessors[0]) {
+    if (identical(thenInput.block, end.predecessors[0])) {
       assert(thenInput.usedBy.length == 1);
       markAsGenerateAtUseSite(thenInput);
     }
diff --git a/lib/compiler/implementation/ssa/js_names.dart b/lib/compiler/implementation/ssa/js_names.dart
index 5df869f..baa468e 100644
--- a/lib/compiler/implementation/ssa/js_names.dart
+++ b/lib/compiler/implementation/ssa/js_names.dart
@@ -156,7 +156,7 @@
   static Set<String> _reserved;
 
   static Set<String> get reserved {
-    if (_reserved === null) {
+    if (_reserved == null) {
       _reserved = new Set<String>();
       _reserved.addAll(reservedPropertySymbols);
       _reserved.addAll(reservedGlobalSymbols);
diff --git a/lib/compiler/implementation/ssa/nodes.dart b/lib/compiler/implementation/ssa/nodes.dart
index 8d1f4c0..1dcd138 100644
--- a/lib/compiler/implementation/ssa/nodes.dart
+++ b/lib/compiler/implementation/ssa/nodes.dart
@@ -104,7 +104,7 @@
   visitBasicBlock(HBasicBlock node) {
     void visitInstructionList(HInstructionList list) {
       HInstruction instruction = list.first;
-      while (instruction !== null) {
+      while (instruction != null) {
         visitInstruction(instruction);
         instruction = instruction.next;
         assert(instruction != list.first);
@@ -140,7 +140,7 @@
     int id = blocks.length;
     block.id = id;
     blocks.add(block);
-    assert(blocks[id] === block);
+    assert(identical(blocks[id], block));
   }
 
   HBasicBlock addNewBlock() {
@@ -172,7 +172,7 @@
 
   HConstant addConstant(Constant constant) {
     HConstant result = constants[constant];
-    if (result === null) {
+    if (result == null) {
       HType type = mapConstantTypeToSsaType(constant);
       result = new HConstant.internal(constant, type);
       entry.addAtExit(result);
@@ -242,7 +242,7 @@
     currentBlock = node;
 
     HInstruction instruction = node.first;
-    while (instruction !== null) {
+    while (instruction != null) {
       instruction.accept(this);
       instruction = instruction.next;
     }
@@ -342,9 +342,9 @@
   const SubGraph(this.start, this.end);
 
   bool contains(HBasicBlock block) {
-    assert(start !== null);
-    assert(end !== null);
-    assert(block !== null);
+    assert(start != null);
+    assert(end != null);
+    assert(block != null);
     return start.id <= block.id && block.id <= end.id;
   }
 }
@@ -366,14 +366,14 @@
   HInstruction last = null;
 
   bool isEmpty() {
-    return first === null;
+    return first == null;
   }
 
   void addAfter(HInstruction cursor, HInstruction instruction) {
-    if (cursor === null) {
+    if (cursor == null) {
       assert(isEmpty());
       first = last = instruction;
-    } else if (cursor === last) {
+    } else if (identical(cursor, last)) {
       last.next = instruction;
       instruction.previous = last;
       last = instruction;
@@ -386,10 +386,10 @@
   }
 
   void addBefore(HInstruction cursor, HInstruction instruction) {
-    if (cursor === null) {
+    if (cursor == null) {
       assert(isEmpty());
       first = last = instruction;
-    } else if (cursor === first) {
+    } else if (identical(cursor, first)) {
       first.previous = instruction;
       instruction.next = first;
       first = instruction;
@@ -404,12 +404,12 @@
   void detach(HInstruction instruction) {
     assert(contains(instruction));
     assert(instruction.isInBasicBlock());
-    if (instruction.previous === null) {
+    if (instruction.previous == null) {
       first = instruction.next;
     } else {
       instruction.previous.next = instruction.next;
     }
-    if (instruction.next === null) {
+    if (instruction.next == null) {
       last = instruction.previous;
     } else {
       instruction.next.previous = instruction.previous;
@@ -427,7 +427,7 @@
   bool contains(HInstruction instruction) {
     HInstruction cursor = first;
     while (cursor != null) {
-      if (cursor === instruction) return true;
+      if (identical(cursor, instruction)) return true;
       cursor = cursor.next;
     }
     return false;
@@ -472,7 +472,7 @@
   bool isClosed() => status == STATUS_CLOSED;
 
   bool isLoopHeader() {
-    return loopInformation !== null;
+    return loopInformation != null;
   }
 
   void setBlockFlow(HBlockInformation blockInfo, HBasicBlock continuation) {
@@ -480,7 +480,7 @@
   }
 
   bool isLabeledBlock() =>
-    blockFlow !== null &&
+    blockFlow != null &&
     blockFlow.body is HLabeledBlockInformation;
 
   HBasicBlock get enclosingLoopHeader {
@@ -618,7 +618,7 @@
   void rewriteWithBetterUser(HInstruction from, HInstruction to) {
     Link<HCheck> better = const Link<HCheck>();
     for (HInstruction user in to.usedBy) {
-      if (user is HCheck && (user as HCheck).checkedInput === to) {
+      if (user is HCheck && identical((user as HCheck).checkedInput, to)) {
         better = better.prepend(user);
       }
     }
@@ -640,12 +640,12 @@
   }
 
   bool isExitBlock() {
-    return first === last && first is HExit;
+    return identical(first, last) && first is HExit;
   }
 
   void addDominatedBlock(HBasicBlock block) {
     assert(isClosed());
-    assert(id !== null && block.id !== null);
+    assert(id != null && block.id != null);
     assert(dominatedBlocks.indexOf(block) < 0);
     // Keep the list of dominated blocks sorted such that if there are two
     // succeeding blocks in the list, the predecessor is before the successor.
@@ -659,13 +659,13 @@
     } else {
       dominatedBlocks.insertRange(index, 1, block);
     }
-    assert(block.dominator === null);
+    assert(block.dominator == null);
     block.dominator = this;
   }
 
   void removeDominatedBlock(HBasicBlock block) {
     assert(isClosed());
-    assert(id !== null && block.id !== null);
+    assert(id != null && block.id != null);
     int index = dominatedBlocks.indexOf(block);
     assert(index >= 0);
     if (index == dominatedBlocks.length - 1) {
@@ -673,31 +673,31 @@
     } else {
       dominatedBlocks.removeRange(index, 1);
     }
-    assert(block.dominator === this);
+    assert(identical(block.dominator, this));
     block.dominator = null;
   }
 
   void assignCommonDominator(HBasicBlock predecessor) {
     assert(isClosed());
-    if (dominator === null) {
+    if (dominator == null) {
       // If this basic block doesn't have a dominator yet we use the
       // given predecessor as the dominator.
       predecessor.addDominatedBlock(this);
-    } else if (predecessor.dominator !== null) {
+    } else if (predecessor.dominator != null) {
       // If the predecessor has a dominator and this basic block has a
       // dominator, we find a common parent in the dominator tree and
       // use that as the dominator.
       HBasicBlock block0 = dominator;
       HBasicBlock block1 = predecessor;
-      while (block0 !== block1) {
+      while (!identical(block0, block1)) {
         if (block0.id > block1.id) {
           block0 = block0.dominator;
         } else {
           block1 = block1.dominator;
         }
-        assert(block0 !== null && block1 !== null);
+        assert(block0 != null && block1 != null);
       }
-      if (dominator !== block0) {
+      if (!identical(dominator, block0)) {
         dominator.removeDominatedBlock(this);
         block0.addDominatedBlock(this);
       }
@@ -706,7 +706,7 @@
 
   void forEachPhi(void f(HPhi phi)) {
     HPhi current = phis.first;
-    while (current !== null) {
+    while (current != null) {
       HInstruction saved = current.next;
       f(current);
       current = saved;
@@ -715,7 +715,7 @@
 
   void forEachInstruction(void f(HInstruction instruction)) {
     HInstruction current = first;
-    while (current !== null) {
+    while (current != null) {
       HInstruction saved = current.next;
       f(current);
       current = saved;
@@ -733,9 +733,9 @@
   // being hot.
   bool dominates(HBasicBlock other) {
     do {
-      if (this === other) return true;
+      if (identical(this, other)) return true;
       other = other.dominator;
-    } while (other !== null && other.id >= id);
+    } while (other != null && other.id >= id);
     return false;
   }
 }
@@ -917,7 +917,7 @@
     return HType.UNKNOWN;
   }
 
-  bool isInBasicBlock() => block !== null;
+  bool isInBasicBlock() => block != null;
 
   String inputsToString() {
     void addAsCommaSeparated(StringBuffer buffer, List<HInstruction> list) {
@@ -948,7 +948,7 @@
     final List<HInstruction> otherInputs = other.inputs;
     if (inputsLength != otherInputs.length) return false;
     for (int i = 0; i < inputsLength; i++) {
-      if (inputs[i] !== otherInputs[i]) return false;
+      if (!identical(inputs[i], otherInputs[i])) return false;
     }
     // Check that the data in the instruction matches.
     return dataEquals(other);
@@ -973,7 +973,7 @@
 
   void notifyAddedToBlock(HBasicBlock targetBlock) {
     assert(!isInBasicBlock());
-    assert(block === null);
+    assert(block == null);
     // Add [this] to the inputs' uses.
     for (int i = 0; i < inputs.length; i++) {
       assert(inputs[i].isInBasicBlock());
@@ -997,7 +997,7 @@
 
   void rewriteInput(HInstruction from, HInstruction to) {
     for (int i = 0; i < inputs.length; i++) {
-      if (inputs[i] === from) inputs[i] = to;
+      if (identical(inputs[i], from)) inputs[i] = to;
     }
   }
 
@@ -1006,7 +1006,7 @@
     List<HInstruction> users = usedBy;
     int length = users.length;
     for (int i = 0; i < length; i++) {
-      if (users[i] === user) {
+      if (identical(users[i], user)) {
         users[i] = users[length - 1];
         length--;
       }
@@ -1018,7 +1018,7 @@
   // updates the [usedBy] of [oldInput] and [newInput].
   void changeUse(HInstruction oldInput, HInstruction newInput) {
     for (int i = 0; i < inputs.length; i++) {
-      if (inputs[i] === oldInput) {
+      if (identical(inputs[i], oldInput)) {
         inputs[i] = newInput;
         newInput.usedBy.add(this);
       }
@@ -1050,7 +1050,7 @@
     for (int i = 0, length = usedBy.length; i < length; i++) {
       HInstruction current = usedBy[i];
       if (otherBlock.dominates(current.block)) {
-        if (current.block === otherBlock) usersInCurrentBlock++;
+        if (identical(current.block, otherBlock)) usersInCurrentBlock++;
         users.add(current);
       }
     }
@@ -1058,7 +1058,7 @@
     // Run through all the phis in the same block as [other] and remove them
     // from the users set.
     if (usersInCurrentBlock > 0) {
-      for (HPhi phi = otherBlock.phis.first; phi !== null; phi = phi.next) {
+      for (HPhi phi = otherBlock.phis.first; phi != null; phi = phi.next) {
         if (users.contains(phi)) {
           users.remove(phi);
           if (--usersInCurrentBlock == 0) break;
@@ -1070,7 +1070,7 @@
     // from the users set.
     if (usersInCurrentBlock > 0) {
       HInstruction current = otherBlock.first;
-      while (current !== other) {
+      while (!identical(current, other)) {
         if (users.contains(current)) {
           users.remove(current);
           if (--usersInCurrentBlock == 0) break;
@@ -1114,8 +1114,8 @@
     if (block != other.block) return block.dominates(other.block);
 
     HInstruction current = this;
-    while (current !== null) {
-      if (current === other) return true;
+    while (current != null) {
+      if (identical(current, other)) return true;
       current = current.next;
     }
     return false;
@@ -1126,9 +1126,9 @@
                            Element sourceElement,
                            int kind) {
     DartType type = sourceElement.computeType(compiler);
-    if (type === null) return this;
-    if (type.element === compiler.dynamicClass) return this;
-    if (type.element === compiler.objectClass) return this;
+    if (type == null) return this;
+    if (identical(type.element, compiler.dynamicClass)) return this;
+    if (identical(type.element, compiler.objectClass)) return this;
 
     // If the original can't be null, type conversion also can't produce null.
     bool canBeNull = this.guaranteedType.canBeNull();
@@ -1406,7 +1406,7 @@
 
 class HInvokeSuper extends HInvokeStatic {
   final bool isSetter;
-  HInvokeSuper(inputs, [this.isSetter = false]) : super(inputs);
+  HInvokeSuper(inputs, {this.isSetter: false}) : super(inputs);
   toString() => 'invoke super: ${element.name}';
   accept(HVisitor visitor) => visitor.visitInvokeSuper(this);
 
@@ -1504,8 +1504,8 @@
 class HFieldGet extends HFieldAccess {
   final bool isAssignable;
 
-  HFieldGet(Element element, HInstruction receiver, [bool isAssignable])
-      : this.isAssignable = (isAssignable !== null)
+  HFieldGet(Element element, HInstruction receiver, {bool isAssignable})
+      : this.isAssignable = (isAssignable != null)
             ? isAssignable
             : element.isAssignable(),
         super(element, <HInstruction>[receiver]);
@@ -1997,14 +1997,14 @@
 class HBreak extends HJump {
   HBreak(TargetElement target) : super(target);
   HBreak.toLabel(LabelElement label) : super.toLabel(label);
-  toString() => (label !== null) ? 'break ${label.labelName}' : 'break';
+  toString() => (label != null) ? 'break ${label.labelName}' : 'break';
   accept(HVisitor visitor) => visitor.visitBreak(this);
 }
 
 class HContinue extends HJump {
   HContinue(TargetElement target) : super(target);
   HContinue.toLabel(LabelElement label) : super.toLabel(label);
-  toString() => (label !== null) ? 'continue ${label.labelName}' : 'continue';
+  toString() => (label != null) ? 'continue ${label.labelName}' : 'continue';
   accept(HVisitor visitor) => visitor.visitContinue(this);
 }
 
@@ -2025,12 +2025,12 @@
   accept(HVisitor visitor) => visitor.visitIf(this);
 
   HBasicBlock get thenBlock {
-    assert(block.dominatedBlocks[0] === block.successors[0]);
+    assert(identical(block.dominatedBlocks[0], block.successors[0]));
     return block.successors[0];
   }
 
   HBasicBlock get elseBlock {
-    assert(block.dominatedBlocks[1] === block.successors[1]);
+    assert(identical(block.dominatedBlocks[1], block.successors[1]));
     return block.successors[1];
   }
 
@@ -2048,7 +2048,7 @@
   accept(HVisitor visitor) => visitor.visitLoopBranch(this);
 
   bool isDoWhile() {
-    return kind === DO_WHILE_LOOP;
+    return identical(kind, DO_WHILE_LOOP);
   }
 }
 
@@ -2399,7 +2399,7 @@
 
 class HThrow extends HControlFlow {
   final bool isRethrow;
-  HThrow(value, [this.isRethrow = false]) : super(<HInstruction>[value]);
+  HThrow(value, {this.isRethrow: false}) : super(<HInstruction>[value]);
   toString() => 'throw';
   accept(HVisitor visitor) => visitor.visitThrow(this);
 }
@@ -2407,7 +2407,7 @@
 class HStatic extends HInstruction {
   final Element element;
   HStatic(this.element) : super(<HInstruction>[]) {
-    assert(element !== null);
+    assert(element != null);
     assert(invariant(this, element.isDeclaration));
   }
 
@@ -2566,7 +2566,7 @@
                        HInstruction typeInfo, [this.nullOk = false])
     : super(<HInstruction>[expression, typeInfo]);
 
-  HIs(this.typeExpression, HInstruction expression, [this.nullOk = false])
+  HIs(this.typeExpression, HInstruction expression, {this.nullOk: false})
      : super(<HInstruction>[expression]);
 
   HInstruction get expression => inputs[0];
@@ -2672,11 +2672,11 @@
   // Adds a block and transitively all its predecessors in the loop as
   // loop blocks.
   void addBlock(HBasicBlock block) {
-    if (block === header) return;
+    if (identical(block, header)) return;
     HBasicBlock parentHeader = block.parentLoopHeader;
-    if (parentHeader === header) {
+    if (identical(parentHeader, header)) {
       // Nothing to do in this case.
-    } else if (parentHeader !== null) {
+    } else if (parentHeader != null) {
       addBlock(parentHeader);
     } else {
       block.parentLoopHeader = header;
@@ -2821,12 +2821,12 @@
 
   HLabeledBlockInformation(this.body,
                            List<LabelElement> labels,
-                           [this.isContinue = false]) :
+                           {this.isContinue: false}) :
       this.labels = labels, this.target = labels[0].target;
 
   HLabeledBlockInformation.implicit(this.body,
                                     this.target,
-                                    [this.isContinue = false])
+                                    {this.isContinue: false})
       : this.labels = const<LabelElement>[];
 
   HBasicBlock get start => body.start;
@@ -2873,7 +2873,7 @@
                         this.endSourcePosition);
 
   HBasicBlock get start {
-    if (initializer !== null) return initializer.start;
+    if (initializer != null) return initializer.start;
     if (kind == DO_WHILE_LOOP) {
       return body.start;
     }
@@ -2885,7 +2885,7 @@
   }
 
   HBasicBlock get end {
-    if (updates !== null) return updates.end;
+    if (updates != null) return updates.end;
     if (kind == DO_WHILE_LOOP) {
       return condition.end;
     }
@@ -2909,7 +2909,7 @@
                       this.elseGraph);
 
   HBasicBlock get start => condition.start;
-  HBasicBlock get end => elseGraph === null ? thenGraph.end : elseGraph.end;
+  HBasicBlock get end => elseGraph == null ? thenGraph.end : elseGraph.end;
 
   bool accept(HStatementInformationVisitor visitor) =>
     visitor.visitIfInfo(this);
@@ -2946,7 +2946,7 @@
 
   HBasicBlock get start => body.start;
   HBasicBlock get end =>
-      finallyBlock === null ? catchBlock.end : finallyBlock.end;
+      finallyBlock == null ? catchBlock.end : finallyBlock.end;
 
   bool accept(HStatementInformationVisitor visitor) =>
     visitor.visitTryInfo(this);
diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart
index 44f876d..d83f85b 100644
--- a/lib/compiler/implementation/ssa/optimize.dart
+++ b/lib/compiler/implementation/ssa/optimize.dart
@@ -128,10 +128,10 @@
 
   visitBasicBlock(HBasicBlock block) {
     HInstruction instruction = block.first;
-    while (instruction !== null) {
+    while (instruction != null) {
       HInstruction next = instruction.next;
       HInstruction replacement = instruction.accept(this);
-      if (replacement !== instruction) {
+      if (!identical(replacement, instruction)) {
         if (!replacement.isInBasicBlock()) {
           // The constant folding can return an instruction that is already
           // part of the graph (like an input), so we only add the replacement
@@ -146,10 +146,10 @@
         if (!types[replacement].isUseful()) {
           types[replacement] = types[instruction];
         }
-        if (replacement.sourceElement === null) {
+        if (replacement.sourceElement == null) {
           replacement.sourceElement = instruction.sourceElement;
         }
-        if (replacement.sourcePosition === null) {
+        if (replacement.sourcePosition == null) {
           replacement.sourcePosition = instruction.sourcePosition;
         }
       }
@@ -168,7 +168,7 @@
     if (input.isBoolean(types)) return input;
     // All values !== true are boolified to false.
     DartType type = types[input].computeType(compiler);
-    if (type !== null && type.element !== compiler.boolClass) {
+    if (type != null && !identical(type.element, compiler.boolClass)) {
       return graph.addConstantBool(false, constantSystem);
     }
     return node;
@@ -194,7 +194,7 @@
       UnaryOperation operation = node.operation(constantSystem);
       HConstant receiver = operand;
       Constant folded = operation.fold(receiver.constant);
-      if (folded !== null) return graph.addConstant(folded);
+      if (folded != null) return graph.addConstant(folded);
     }
     return node;
   }
@@ -338,7 +338,7 @@
       HConstant op1 = left;
       HConstant op2 = right;
       Constant folded = operation.fold(op1.constant, op2.constant);
-      if (folded !== null) return graph.addConstant(folded);
+      if (folded != null) return graph.addConstant(folded);
     }
 
     if (!left.canBePrimitive(types)
@@ -366,7 +366,7 @@
       HStatic oldTarget = node.target;
       Element boolifiedInterceptor =
           interceptors.getBoolifiedVersionOf(oldTarget.element);
-      if (boolifiedInterceptor !== null) {
+      if (boolifiedInterceptor != null) {
         HStatic boolifiedTarget = new HStatic(boolifiedInterceptor);
         // We don't remove the [oldTarget] in case it is used by other
         // instructions. If it is unused it will be treated as dead code and
@@ -424,13 +424,13 @@
 
   HInstruction visitIdentity(HIdentity node) {
     HInstruction newInstruction = handleIdentityCheck(node);
-    return newInstruction === null ? super.visitIdentity(node) : newInstruction;
+    return newInstruction == null ? super.visitIdentity(node) : newInstruction;
   }
 
   HInstruction foldBuiltinEqualsCheck(HEquals node) {
     // TODO(floitsch): cache interceptors.
     HInstruction newInstruction = handleIdentityCheck(node);
-    if (newInstruction === null) {
+    if (newInstruction == null) {
       HStatic target = new HStatic(
           backend.builder.interceptors.getTripleEqualsInterceptor());
       node.block.addBefore(node, target);
@@ -456,7 +456,7 @@
     if (leftType.isExact()) {
       HBoundedType type = leftType;
       Element element = type.lookupMember(Elements.OPERATOR_EQUALS);
-      if (element !== null) {
+      if (element != null) {
         // If the left-hand side is guaranteed to be a non-primitive
         // type and and it defines operator==, we emit a call to that
         // operator.
@@ -494,20 +494,20 @@
   HInstruction visitIs(HIs node) {
     DartType type = node.typeExpression;
     Element element = type.element;
-    if (element.kind === ElementKind.TYPE_VARIABLE) {
+    if (identical(element.kind, ElementKind.TYPE_VARIABLE)) {
       compiler.unimplemented("visitIs for type variables");
     }
 
     HType expressionType = types[node.expression];
-    if (element === compiler.objectClass
-        || element === compiler.dynamicClass) {
+    if (identical(element, compiler.objectClass)
+        || identical(element, compiler.dynamicClass)) {
       return graph.addConstantBool(true, constantSystem);
     } else if (expressionType.isInteger()) {
-      if (element === compiler.intClass
-          || element === compiler.numClass
+      if (identical(element, compiler.intClass)
+          || identical(element, compiler.numClass)
           || Elements.isNumberOrStringSupertype(element, compiler)) {
         return graph.addConstantBool(true, constantSystem);
-      } else if (element === compiler.doubleClass) {
+      } else if (identical(element, compiler.doubleClass)) {
         // We let the JS semantics decide for that check. Currently
         // the code we emit will always return true.
         return node;
@@ -515,11 +515,11 @@
         return graph.addConstantBool(false, constantSystem);
       }
     } else if (expressionType.isDouble()) {
-      if (element === compiler.doubleClass
-          || element === compiler.numClass
+      if (identical(element, compiler.doubleClass)
+          || identical(element, compiler.numClass)
           || Elements.isNumberOrStringSupertype(element, compiler)) {
         return graph.addConstantBool(true, constantSystem);
-      } else if (element === compiler.intClass) {
+      } else if (identical(element, compiler.intClass)) {
         // We let the JS semantics decide for that check. Currently
         // the code we emit will return true for a double that can be
         // represented as a 31-bit integer and for -0.0.
@@ -528,13 +528,13 @@
         return graph.addConstantBool(false, constantSystem);
       }
     } else if (expressionType.isNumber()) {
-      if (element === compiler.numClass) {
+      if (identical(element, compiler.numClass)) {
         return graph.addConstantBool(true, constantSystem);
       }
       // We cannot just return false, because the expression may be of
       // type int or double.
     } else if (expressionType.isString()) {
-      if (element === compiler.stringClass
+      if (identical(element, compiler.stringClass)
                || Elements.isStringOnlySupertype(element, compiler)
                || Elements.isNumberOrStringSupertype(element, compiler)) {
         return graph.addConstantBool(true, constantSystem);
@@ -542,7 +542,7 @@
         return graph.addConstantBool(false, constantSystem);
       }
     } else if (expressionType.isArray()) {
-      if (element === compiler.listClass
+      if (identical(element, compiler.listClass)
           || Elements.isListSupertype(element, compiler)) {
         return graph.addConstantBool(true, constantSystem);
       } else {
@@ -553,7 +553,7 @@
                && !expressionType.canBeNull()
                && !compiler.codegenWorld.rti.hasTypeArguments(type)) {
       DartType receiverType = expressionType.computeType(compiler);
-      if (receiverType !== null) {
+      if (receiverType != null) {
         if (compiler.types.isSubtype(receiverType, type)) {
           return graph.addConstantBool(true, constantSystem);
         } else if (expressionType.isExact()) {
@@ -567,8 +567,8 @@
   HInstruction visitTypeConversion(HTypeConversion node) {
     HInstruction value = node.inputs[0];
     DartType type = types[node].computeType(compiler);
-    if (type.element === compiler.dynamicClass
-        || type.element === compiler.objectClass) {
+    if (identical(type.element, compiler.dynamicClass)
+        || identical(type.element, compiler.objectClass)) {
       return value;
     }
     if (types[value].canBeNull() && node.isBooleanConversionCheck) {
@@ -584,7 +584,7 @@
     if (!receiverType.isUseful()) return null;
     if (receiverType.canBeNull()) return null;
     DartType type = receiverType.computeType(compiler);
-    if (type === null) return null;
+    if (type == null) return null;
     return compiler.world.locateSingleField(type, selector);
   }
 
@@ -614,7 +614,7 @@
   HInstruction visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
     Element field =
         findConcreteFieldForDynamicAccess(node.receiver, node.selector);
-    if (field === null) return node;
+    if (field == null) return node;
     HInstruction value = node.inputs[1];
     if (compiler.enableTypeAssertions) {
       HInstruction other = value.convertType(
@@ -663,7 +663,7 @@
 
   void visitBasicBlock(HBasicBlock block) {
     HInstruction instruction = block.first;
-    while (instruction !== null) {
+    while (instruction != null) {
       HInstruction next = instruction.next;
       instruction = instruction.accept(this);
       instruction = next;
@@ -754,7 +754,7 @@
 
   void visitBasicBlock(HBasicBlock block) {
     HInstruction instruction = block.last;
-    while (instruction !== null) {
+    while (instruction != null) {
       var previous = instruction.previous;
       if (isDeadCode(instruction)) block.remove(instruction);
       instruction = previous;
@@ -838,13 +838,13 @@
       // Find if the inputs of the phi are the same instruction.
       // The builder ensures that phi.inputs[0] cannot be the phi
       // itself.
-      assert(phi.inputs[0] !== phi);
+      assert(!identical(phi.inputs[0], phi));
       HInstruction candidate = phi.inputs[0];
       for (int i = 1; i < phi.inputs.length; i++) {
         HInstruction input = phi.inputs[i];
         // If the input is the phi, the phi is still candidate for
         // elimination.
-        if (input !== candidate && input !== phi) {
+        if (!identical(input, candidate) && !identical(input, phi)) {
           candidate = null;
           break;
         }
@@ -943,14 +943,14 @@
       int flags = loopChangesFlags[block.id];
       values.kill(flags);
     }
-    while (instruction !== null) {
+    while (instruction != null) {
       HInstruction next = instruction.next;
       int flags = instruction.getChangesFlags();
       assert(flags == 0 || !instruction.useGvn());
       values.kill(flags);
       if (instruction.useGvn()) {
         HInstruction other = values.lookup(instruction);
-        if (other !== null) {
+        if (other != null) {
           assert(other.gvnEquals(instruction) && instruction.gvnEquals(other));
           block.rewriteWithBetterUser(instruction, other);
           block.remove(instruction);
@@ -999,12 +999,12 @@
       // Compute block changes flags for the block.
       int changesFlags = 0;
       HInstruction instruction = block.first;
-      while (instruction !== null) {
+      while (instruction != null) {
         instruction.prepareGvn(types);
         changesFlags |= instruction.getChangesFlags();
         instruction = instruction.next;
       }
-      assert(blockChangesFlags[id] === null);
+      assert(blockChangesFlags[id] == null);
       blockChangesFlags[id] = changesFlags;
 
       // Loop headers are part of their loop, so update the loop
@@ -1015,7 +1015,7 @@
 
       // Propagate loop changes flags upwards.
       HBasicBlock parentLoopHeader = block.parentLoopHeader;
-      if (parentLoopHeader !== null) {
+      if (parentLoopHeader != null) {
         loopChangesFlags[parentLoopHeader.id] |= (block.isLoopHeader())
             ? loopChangesFlags[id]
             : changesFlags;
@@ -1111,7 +1111,7 @@
     ValueSet set_ = values[block.id];
     HInstruction instruction = block.first;
     int flags = 0;
-    while (instruction !== null) {
+    while (instruction != null) {
       int dependsFlags = HInstruction.computeDependsOnFlags(flags);
       flags |= instruction.getChangesFlags();
 
@@ -1302,12 +1302,12 @@
     // type will not be used if the field is in any of these.
     int j = 0;
     node.element.forEachInstanceField(
-      includeBackendMembers: false,
-      includeSuperMembers: true,
-      f: (ClassElement enclosingClass, Element element) {
-        backend.registerFieldInitializer(element, types[node.inputs[j]]);
-        j++;
-      });
+        (ClassElement enclosingClass, Element element) {
+          backend.registerFieldInitializer(element, types[node.inputs[j]]);
+          j++;
+        },
+        includeBackendMembers: false,
+        includeSuperMembers: true);
   }
 
   visitFieldSet(HFieldSet node) {
@@ -1319,7 +1319,7 @@
     // Don't handle fields defined in superclasses. Given that the field is
     // always added to the [allSetters] set, setting a field defined in a
     // superclass will get an inferred type of UNKNOWN.
-    if (work.element.getEnclosingClass() === field.getEnclosingClass() &&
+    if (identical(work.element.getEnclosingClass(), field.getEnclosingClass()) &&
         value.hasGuaranteedType()) {
       currentFieldSetters[field] = type;
     }
diff --git a/lib/compiler/implementation/ssa/ssa.dart b/lib/compiler/implementation/ssa/ssa.dart
index 4a6ce7a..0e83a74 100644
--- a/lib/compiler/implementation/ssa/ssa.dart
+++ b/lib/compiler/implementation/ssa/ssa.dart
@@ -2,34 +2,37 @@
 // 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('ssa');
+library ssa;
 
-#import('../closure.dart');
-#import('../js/js.dart', prefix: 'js');
-#import('../leg.dart');
-#import('../source_file.dart');
-#import('../source_map_builder.dart');
-#import('../elements/elements.dart');
-#import('../js_backend/js_backend.dart');
-#import('../native_handler.dart', prefix: 'native');
-#import('../runtime_types.dart');
-#import('../scanner/scannerlib.dart');
-#import('../tree/tree.dart');
-#import('../types/types.dart');
-#import('../universe/universe.dart');
-#import('../util/util.dart');
-#import('../util/characters.dart');
+import '../closure.dart';
+import '../js/js.dart' as js;
+import '../dart2jslib.dart' hide Selector;
+import '../source_file.dart';
+import '../source_map_builder.dart';
+import '../elements/elements.dart';
+import '../js_backend/js_backend.dart';
+import '../native_handler.dart' as native;
+import '../runtime_types.dart';
+import '../tree/tree.dart';
+import '../types/types.dart';
+import '../universe/universe.dart';
+import '../util/util.dart';
+import '../util/characters.dart';
 
-#source('bailout.dart');
-#source('builder.dart');
-#source('codegen.dart');
-#source('codegen_helpers.dart');
-#source('js_names.dart');
-#source('nodes.dart');
-#source('optimize.dart');
-#source('types.dart');
-#source('types_propagation.dart');
-#source('validate.dart');
-#source('variable_allocator.dart');
-#source('value_range_analyzer.dart');
-#source('value_set.dart');
+import '../scanner/scannerlib.dart' show PartialFunctionElement,
+                                         Token,
+                                         PLUS_TOKEN;
+
+part 'bailout.dart';
+part 'builder.dart';
+part 'codegen.dart';
+part 'codegen_helpers.dart';
+part 'js_names.dart';
+part 'nodes.dart';
+part 'optimize.dart';
+part 'types.dart';
+part 'types_propagation.dart';
+part 'validate.dart';
+part 'variable_allocator.dart';
+part 'value_range_analyzer.dart';
+part 'value_set.dart';
diff --git a/lib/compiler/implementation/ssa/tracer.dart b/lib/compiler/implementation/ssa/tracer.dart
index e346b44..4b3520d 100644
--- a/lib/compiler/implementation/ssa/tracer.dart
+++ b/lib/compiler/implementation/ssa/tracer.dart
@@ -2,12 +2,12 @@
 // 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('tracer');
+library tracer;
 
-#import('dart:io');
-#import('ssa.dart');
-#import('../js_backend/js_backend.dart');
-#import('../leg.dart');
+import 'dart:io';
+import 'ssa.dart';
+import '../js_backend/js_backend.dart';
+import '../dart2jslib.dart';
 
 const bool GENERATE_SSA_TRACE = false;
 const String SSA_TRACE_FILTER = null;
@@ -79,7 +79,7 @@
                        HInstructionList list) {
     HTypeMap types = context.types;
     for (HInstruction instruction = list.first;
-         instruction !== null;
+         instruction != null;
          instruction = instruction.next) {
       int bci = 0;
       int uses = instruction.usedBy.length;
@@ -95,7 +95,7 @@
   void visitBasicBlock(HBasicBlock block) {
     HInstructionStringifier stringifier =
         new HInstructionStringifier(context, block);
-    assert(block.id !== null);
+    assert(block.id != null);
     tag("block", () {
       printProperty("name", "B${block.id}");
       printProperty("from_bci", -1);
@@ -104,7 +104,7 @@
       addSuccessors(block);
       printEmptyProperty("xhandlers");
       printEmptyProperty("flags");
-      if (block.dominator !== null) {
+      if (block.dominator != null) {
         printProperty("dominator", "B${block.dominator.id}");
       }
       tag("states", () {
@@ -243,7 +243,7 @@
 
   String visitBreak(HBreak node) {
     HBasicBlock target = currentBlock.successors[0];
-    if (node.label !== null) {
+    if (node.label != null) {
       return "Break ${node.label.labelName}: (B${target.id})";
     }
     return "Break: (B${target.id})";
@@ -253,7 +253,7 @@
 
   String visitContinue(HContinue node) {
     HBasicBlock target = currentBlock.successors[0];
-    if (node.label !== null) {
+    if (node.label != null) {
       return "Continue ${node.label.labelName}: (B${target.id})";
     }
     return "Continue: (B${target.id})";
diff --git a/lib/compiler/implementation/ssa/types.dart b/lib/compiler/implementation/ssa/types.dart
index b94fcae..b5dd364 100644
--- a/lib/compiler/implementation/ssa/types.dart
+++ b/lib/compiler/implementation/ssa/types.dart
@@ -13,23 +13,23 @@
                                 Compiler compiler,
                                 [bool canBeNull = false]) {
     Element element = type.element;
-    if (element.kind === ElementKind.TYPE_VARIABLE) {
+    if (identical(element.kind, ElementKind.TYPE_VARIABLE)) {
       // TODO(ngeoffray): Replace object type with [type].
       return new HBoundedPotentialPrimitiveType(
           compiler.objectClass.computeType(compiler), canBeNull);
     }
 
-    if (element === compiler.intClass) {
+    if (identical(element, compiler.intClass)) {
       return canBeNull ? HType.INTEGER_OR_NULL : HType.INTEGER;
-    } else if (element === compiler.numClass) {
+    } else if (identical(element, compiler.numClass)) {
       return canBeNull ? HType.NUMBER_OR_NULL : HType.NUMBER;
-    } else if (element === compiler.doubleClass) {
+    } else if (identical(element, compiler.doubleClass)) {
       return canBeNull ? HType.DOUBLE_OR_NULL : HType.DOUBLE;
-    } else if (element === compiler.stringClass) {
+    } else if (identical(element, compiler.stringClass)) {
       return canBeNull ? HType.STRING_OR_NULL : HType.STRING;
-    } else if (element === compiler.boolClass) {
+    } else if (identical(element, compiler.boolClass)) {
       return canBeNull ? HType.BOOLEAN_OR_NULL : HType.BOOLEAN;
-    } else if (element === compiler.listClass
+    } else if (identical(element, compiler.listClass)
         || Elements.isListSupertype(element, compiler)) {
       return new HBoundedPotentialPrimitiveArray(type, canBeNull);
     } else if (Elements.isNumberOrStringSupertype(element, compiler)) {
@@ -62,8 +62,8 @@
   static const HType DOUBLE_OR_NULL = const HDoubleOrNullType();
   static const HType STRING_OR_NULL = const HStringOrNullType();
 
-  bool isConflicting() => this === CONFLICTING;
-  bool isUnknown() => this === UNKNOWN;
+  bool isConflicting() => identical(this, CONFLICTING);
+  bool isUnknown() => identical(this, UNKNOWN);
   bool isNull() => false;
   bool isBoolean() => false;
   bool isNumber() => false;
@@ -683,8 +683,8 @@
   const HBoundedType(DartType this.type,
                      [bool canBeNull = false, isExact = false])
       : _canBeNull = canBeNull, _isExact = isExact;
-  const HBoundedType.exact(DartType type) : this(type, isExact: true);
-  const HBoundedType.withNull(DartType type) : this(type, canBeNull: true);
+  const HBoundedType.exact(DartType type) : this(type, false, true);
+  const HBoundedType.withNull(DartType type) : this(type, true, false);
   const HBoundedType.nonNull(DartType type) : this(type);
 
   DartType computeType(Compiler compiler) => type;
@@ -701,7 +701,7 @@
     if (other.isNull()) return canBeNull() ? HType.NULL : HType.CONFLICTING;
     if (other is HBoundedType) {
       HBoundedType temp = other;
-      if (this.type === temp.type) {
+      if (identical(this.type, temp.type)) {
         if (isExact()) {
           return this;
         } else if (other.isExact()) {
@@ -721,8 +721,8 @@
   bool operator ==(HType other) {
     if (other is !HBoundedType) return false;
     HBoundedType bounded = other;
-    return (type === bounded.type && canBeNull() === bounded.canBeNull()
-            && isExact() === other .isExact());
+    return (identical(type, bounded.type) && identical(canBeNull(), bounded.canBeNull())
+            && identical(isExact(), other .isExact()));
   }
 
   HType union(HType other) {
@@ -735,7 +735,7 @@
     }
     if (other is HBoundedType) {
       HBoundedType temp = other;
-      if (type !== temp.type) return HType.UNKNOWN;
+      if (!identical(type, temp.type)) return HType.UNKNOWN;
       if (isExact()) return other;
       if (other.isExact()) return this;
       return canBeNull() ? this : other;
diff --git a/lib/compiler/implementation/ssa/types_propagation.dart b/lib/compiler/implementation/ssa/types_propagation.dart
index 5072171..377f233 100644
--- a/lib/compiler/implementation/ssa/types_propagation.dart
+++ b/lib/compiler/implementation/ssa/types_propagation.dart
@@ -88,7 +88,7 @@
     }
 
     HInstruction instruction = block.first;
-    while (instruction !== null) {
+    while (instruction != null) {
       if (updateType(instruction)) {
         addDependentInstructionsToWorkList(instruction);
       }
@@ -101,7 +101,7 @@
       while (!worklist.isEmpty()) {
         int id = worklist.removeLast();
         HInstruction instruction = workmap[id];
-        assert(instruction !== null);
+        assert(instruction != null);
         workmap.remove(id);
         if (updateType(instruction)) {
           addDependentInstructionsToWorkList(instruction);
diff --git a/lib/compiler/implementation/ssa/validate.dart b/lib/compiler/implementation/ssa/validate.dart
index 538d9f6..94bc136 100644
--- a/lib/compiler/implementation/ssa/validate.dart
+++ b/lib/compiler/implementation/ssa/validate.dart
@@ -24,7 +24,7 @@
 
     // Test that the last instruction is a branching instruction and that the
     // basic block contains the branch-target.
-    if (block.first === null || block.last === null) {
+    if (block.first == null || block.last == null) {
       markInvalid("empty block");
     }
     if (block.last is !HControlFlow) {
@@ -61,10 +61,10 @@
 
     // Check that successors ids are always higher than the current one.
     // TODO(floitsch): this is, of course, not true for back-branches.
-    if (block.id === null) markInvalid("block without id");
+    if (block.id == null) markInvalid("block without id");
     for (HBasicBlock successor in block.successors) {
       if (!isValid) break;
-      if (successor.id === null) markInvalid("successor without id");
+      if (successor.id == null) markInvalid("successor without id");
       if (successor.id <= block.id && !successor.isLoopHeader()) {
         markInvalid("successor with lower id, but not a loop-header");
       }
@@ -74,10 +74,10 @@
     int lastId = 0;
     for (HBasicBlock dominated in block.dominatedBlocks) {
       if (!isValid) break;
-      if (dominated.dominator !== block) {
+      if (!identical(dominated.dominator, block)) {
         markInvalid("dominated block not pointing back");
       }
-      if (dominated.id === null || dominated.id <= lastId) {
+      if (dominated.id == null || dominated.id <= lastId) {
         markInvalid("dominated.id === null or dominated has <= id");
       }
       lastId = dominated.id;
@@ -116,7 +116,7 @@
                               HInstruction instruction) {
     int result = 0;
     for (int i = 0; i < instructions.length; i++) {
-      if (instructions[i] === instruction) result++;
+      if (identical(instructions[i], instruction)) result++;
     }
     return result;
   }
@@ -132,10 +132,10 @@
     // we have assigned an ID. The loop is therefore O(n^2) for now.
     for (int i = 0; i < copy.length; i++) {
       var current = copy[i];
-      if (current === null) continue;
+      if (current == null) continue;
       int count = 1;
       for (int j = i + 1; j < copy.length; j++) {
-        if (copy[j] === current) {
+        if (identical(copy[j], current)) {
           copy[j] = null;
           count++;
         }
@@ -166,7 +166,7 @@
       });
     }
 
-    if (instruction.block !== currentBlock) {
+    if (!identical(instruction.block, currentBlock)) {
       markInvalid("Instruction in wrong block");
     }
     if (!hasCorrectInputs()) {
diff --git a/lib/compiler/implementation/ssa/value_set.dart b/lib/compiler/implementation/ssa/value_set.dart
index 3de055f..bb50d61 100644
--- a/lib/compiler/implementation/ssa/value_set.dart
+++ b/lib/compiler/implementation/ssa/value_set.dart
@@ -12,7 +12,7 @@
   int get length => size;
 
   void add(HInstruction instruction) {
-    assert(lookup(instruction) === null);
+    assert(lookup(instruction) == null);
     int hashCode = instruction.gvnHashCode();
     int capacity = table.length;
     // Resize when half of the hash table is in use.
@@ -22,7 +22,7 @@
     }
     // Try to insert in the hash table first.
     int index = hashCode % capacity;
-    if (table[index] === null) {
+    if (table[index] == null) {
       table[index] = instruction;
     } else {
       collisions = new ValueSetNode(instruction, hashCode, collisions);
@@ -35,9 +35,9 @@
     int index = hashCode % table.length;
     // Look in the hash table.
     HInstruction probe = table[index];
-    if (probe !== null && probe.gvnEquals(instruction)) return probe;
+    if (probe != null && probe.gvnEquals(instruction)) return probe;
     // Look in the collisions list.
-    for (ValueSetNode node = collisions; node !== null; node = node.next) {
+    for (ValueSetNode node = collisions; node != null; node = node.next) {
       if (node.hashCode() == hashCode) {
         HInstruction cached = node.value;
         if (cached.gvnEquals(instruction)) return cached;
@@ -52,7 +52,7 @@
     // Kill in the hash table.
     for (int index = 0, length = table.length; index < length; index++) {
       HInstruction instruction = table[index];
-      if (instruction !== null && (instruction.flags & depends) != 0) {
+      if (instruction != null && (instruction.flags & depends) != 0) {
         table[index] = null;
         size--;
       }
@@ -60,11 +60,11 @@
     // Kill in the collisions list.
     ValueSetNode previous = null;
     ValueSetNode current = collisions;
-    while (current !== null) {
+    while (current != null) {
       ValueSetNode next = current.next;
       HInstruction cached = current.value;
       if ((cached.flags & depends) != 0) {
-        if (previous === null) {
+        if (previous == null) {
           collisions = next;
         } else {
           previous.next = next;
@@ -93,11 +93,11 @@
     // Copy elements from the hash table.
     for (int index = 0, length = table.length; index < length; index++) {
       HInstruction instruction = table[index];
-      if (instruction !== null) other.add(instruction);
+      if (instruction != null) other.add(instruction);
     }
     // Copy elements from the collision list.
     ValueSetNode current = collisions;
-    while (current !== null) {
+    while (current != null) {
       // TODO(kasperl): Maybe find a way of reusing the hash code
       // rather than recomputing it every time.
       other.add(current.value);
@@ -112,15 +112,15 @@
     // Look in the hash table.
     for (int index = 0, length = table.length; index < length; index++) {
       HInstruction instruction = table[index];
-      if (instruction !== null && other.lookup(instruction) !== null) {
+      if (instruction != null && other.lookup(instruction) != null) {
         result.add(instruction);
       }
     }
     // Look in the collision list.
     ValueSetNode current = collisions;
-    while (current !== null) {
+    while (current != null) {
       HInstruction value = current.value;
-      if (other.lookup(value) !== null) {
+      if (other.lookup(value) != null) {
         result.add(value);
       }
       current = current.next;
diff --git a/lib/compiler/implementation/ssa/variable_allocator.dart b/lib/compiler/implementation/ssa/variable_allocator.dart
index d317a4a..8844a8c 100644
--- a/lib/compiler/implementation/ssa/variable_allocator.dart
+++ b/lib/compiler/implementation/ssa/variable_allocator.dart
@@ -251,7 +251,7 @@
     for (int i = 0; i < block.successors.length; i++) {
       HBasicBlock successor = block.successors[i];
       LiveEnvironment successorEnv = liveInstructions[successor];
-      if (successorEnv !== null) {
+      if (successorEnv != null) {
         environment.mergeWith(successorEnv);
       } else {
         environment.addLoopMarker(successor, instructionId);
@@ -442,7 +442,7 @@
     // add them to the list of used names.
     environment.liveInstructions.forEach((HInstruction instruction, int index) {
       String name = names.getName(instruction);
-      if (name !== null) {
+      if (name != null) {
         usedNames.add(name);
       }
     });
@@ -469,7 +469,7 @@
 
   HPhi firstPhiUserWithElement(HInstruction instruction) {
     for (HInstruction user in instruction.usedBy) {
-      if (user is HPhi && user.sourceElement !== null) {
+      if (user is HPhi && user.sourceElement != null) {
         return user;
       }
     }
@@ -486,7 +486,7 @@
         temp = temp.checkedInput;
         name = names.ownName[temp];
       } while (name == null && temp is HCheck);
-      if (name !== null) return addAllocatedName(instruction, name);
+      if (name != null) return addAllocatedName(instruction, name);
     } else if (instruction is HParameterValue) {
       HParameterValue parameter = instruction;
       name = parameterNames[parameter.sourceElement];
@@ -496,14 +496,14 @@
       return addAllocatedName(instruction, name);
     }
 
-    if (instruction.sourceElement !== null) {
+    if (instruction.sourceElement != null) {
       name = allocateWithHint(instruction.sourceElement.name.slowToString());
     } else {
       // We could not find an element for the instruction. If the
       // instruction is used by a phi, try to use the name of the phi.
       // Otherwise, just allocate a temporary name.
       HPhi phi = firstPhiUserWithElement(instruction);
-      if (phi !== null) {
+      if (phi != null) {
         name = allocateWithHint(phi.sourceElement.name.slowToString());
       } else {
         name = allocateTemporary();
diff --git a/lib/compiler/implementation/string_validator.dart b/lib/compiler/implementation/string_validator.dart
index 0c54780..2951f56 100644
--- a/lib/compiler/implementation/string_validator.dart
+++ b/lib/compiler/implementation/string_validator.dart
@@ -4,13 +4,13 @@
 
 // Check the validity of string literals.
 
-#library("stringvalidator");
+library stringvalidator;
 
-#import("leg.dart");
-#import("scanner/scannerlib.dart");
-#import("tree/tree.dart");
-#import("elements/elements.dart");
-#import("util/characters.dart");
+import "dart2jslib.dart";
+import "tree/tree.dart";
+import "elements/elements.dart";
+import "util/characters.dart";
+import "scanner/scannerlib.dart" show Token;
 
 class StringValidator {
   final DiagnosticListener listener;
@@ -30,8 +30,8 @@
   }
 
   DartString validateInterpolationPart(Token token, StringQuoting quoting,
-                                       [bool isFirst = false,
-                                        bool isLast = false]) {
+                                       {bool isFirst: false,
+                                        bool isLast: false}) {
     SourceString source = token.value;
     int leftQuote = 0;
     int rightQuote = 0;
@@ -49,29 +49,28 @@
     bool raw = false;
     int quoteLength = 1;
     int quoteChar = source.next();
-    // TODO(aprelev@gmail.com): Remove deprecated "quoteChar === $AT ||" below.
-    if (quoteChar === $AT || quoteChar === $r) {
+    if (quoteChar === $r) {
       raw = true;
       quoteChar = source.next();
     }
-    assert(quoteChar === $SQ || quoteChar === $DQ);
+    assert(identical(quoteChar, $SQ) || identical(quoteChar, $DQ));
     // String has at least one quote. Check it if has three.
     // If it only have two, the string must be an empty string literal,
     // and end after the second quote.
     bool multiline = false;
-    if (source.hasNext() && source.next() === quoteChar && source.hasNext()) {
+    if (source.hasNext() && identical(source.next(), quoteChar) && source.hasNext()) {
       int code = source.next();
-      assert(code === quoteChar);  // If not, there is a bug in the parser.
+      assert(identical(code, quoteChar));  // If not, there is a bug in the parser.
       quoteLength = 3;
       // Check if a multiline string starts with a newline (CR, LF or CR+LF).
       if (source.hasNext()) {
         code = source.next();
-        if (code === $CR) {
+        if (identical(code, $CR)) {
           quoteLength += 1;
-          if (source.hasNext() && source.next() === $LF) {
+          if (source.hasNext() && identical(source.next(), $LF)) {
             quoteLength += 1;
           }
-        } else if (code === $LF) {
+        } else if (identical(code, $LF)) {
           quoteLength += 1;
         }
       }
@@ -100,7 +99,7 @@
     for(Iterator<int> iter = string.iterator(); iter.hasNext(); length++) {
       index++;
       int code = iter.next();
-      if (code === $BACKSLASH) {
+      if (identical(code, $BACKSLASH)) {
         if (quoting.raw) continue;
         containsEscape = true;
         if (!iter.hasNext()) {
@@ -109,7 +108,7 @@
         }
         index++;
         code = iter.next();
-        if (code === $x) {
+        if (identical(code, $x)) {
           for (int i = 0; i < 2; i++) {
             if (!iter.hasNext()) {
               stringParseError("Incomplete escape sequence", token, index);
@@ -125,7 +124,7 @@
           }
           // A two-byte hex escape can't generate an invalid value.
           continue;
-        } else if (code === $u) {
+        } else if (identical(code, $u)) {
           int escapeStart = index - 1;
           index++;
           code = iter.next();
diff --git a/lib/compiler/implementation/tools/mini_parser.dart b/lib/compiler/implementation/tools/mini_parser.dart
index a3edb40..492b815 100644
--- a/lib/compiler/implementation/tools/mini_parser.dart
+++ b/lib/compiler/implementation/tools/mini_parser.dart
@@ -47,7 +47,7 @@
     } else {
       print('Parsed $stats.');
     }
-    if (filesWithCrashes.length !== 0) {
+    if (filesWithCrashes.length != 0) {
       print('The following ${filesWithCrashes.length} files caused a crash:');
       for (String file in filesWithCrashes) {
         print(file);
@@ -151,7 +151,7 @@
   StringInputStream stringStream = new StringInputStream(input);
   stringStream.onLine = () {
     String line;
-    while ((line = stringStream.readLine()) !== null) {
+    while ((line = stringStream.readLine()) != null) {
       lineHandler(line);
     }
   };
@@ -201,7 +201,7 @@
 String formatError(String message, Token beginToken, Token endToken,
                    SourceFile file) {
   ++errorCount;
-  if (beginToken === null) return '${file.filename}: $message';
+  if (beginToken == null) return '${file.filename}: $message';
   String tokenString = endToken.toString();
   int begin = beginToken.charOffset;
   int end = endToken.charOffset + tokenString.length;
@@ -264,13 +264,13 @@
 
   void log(String message) {}
 
-  void cancel([String reason, node, token, instruction, element]) {
+  void cancel(String reason, {node, token, instruction, element}) {
     Token beginToken;
     Token endToken;
-    if (token !== null) {
+    if (token != null) {
       beginToken = token;
       endToken = token;
-    } else if (node !== null) {
+    } else if (node != null) {
       beginToken = node.getBeginToken();
       endToken = node.getEndToken();
     }
@@ -298,7 +298,7 @@
     if (rawText is String) {
       return rawText;
     } else {
-      if (stringText === null) {
+      if (stringText == null) {
         stringText = new String.fromCharCodes(rawText);
         if (stringText.endsWith('\u0000')) {
           // Strip trailing NUL used by ByteArrayScanner to signal EOF.
diff --git a/lib/compiler/implementation/tree/dartstring.dart b/lib/compiler/implementation/tree/dartstring.dart
index 30198fa..0d7f70c 100644
--- a/lib/compiler/implementation/tree/dartstring.dart
+++ b/lib/compiler/implementation/tree/dartstring.dart
@@ -76,7 +76,7 @@
   RawSourceDartString(source, length) : super(source, length);
   Iterator<int> iterator() => source.iterator();
   String slowToString() {
-    if (toStringCache !== null) return toStringCache;
+    if (toStringCache != null) return toStringCache;
     toStringCache  = source.slowToString();
     return toStringCache;
   }
@@ -89,11 +89,11 @@
 class EscapedSourceDartString extends SourceBasedDartString {
   EscapedSourceDartString(source, length) : super(source, length);
   Iterator<int> iterator() {
-    if (toStringCache !== null) return new StringCodeIterator(toStringCache);
+    if (toStringCache != null) return new StringCodeIterator(toStringCache);
     return new StringEscapeIterator(source);
   }
   String slowToString() {
-    if (toStringCache !== null) return toStringCache;
+    if (toStringCache != null) return toStringCache;
     StringBuffer buffer = new StringBuffer();
     StringEscapeIterator it = new StringEscapeIterator(source);
     while (it.hasNext()) {
@@ -120,7 +120,7 @@
   Iterator<int> iterator() => new ConsDartStringIterator(this);
 
   String slowToString() {
-    if (toStringCache !== null) return toStringCache;
+    if (toStringCache != null) return toStringCache;
     toStringCache = left.slowToString().concat(right.slowToString());
     return toStringCache;
   }
@@ -152,7 +152,7 @@
     return result;
   }
   void nextPart() {
-    if (right !== null) {
+    if (right != null) {
       current = right.iterator();
       right = null;
       hasNextLookAhead = current.hasNext();
@@ -169,25 +169,25 @@
   bool hasNext() => source.hasNext();
   int next() {
     int code = source.next();
-    if (code !== $BACKSLASH) {
+    if (!identical(code, $BACKSLASH)) {
       return code;
     }
     code = source.next();
-    if (code === $n) return $LF;
-    if (code === $r) return $CR;
-    if (code === $t) return $TAB;
-    if (code === $b) return $BS;
-    if (code === $f) return $FF;
-    if (code === $v) return $VTAB;
-    if (code === $x) {
+    if (identical(code, $n)) return $LF;
+    if (identical(code, $r)) return $CR;
+    if (identical(code, $t)) return $TAB;
+    if (identical(code, $b)) return $BS;
+    if (identical(code, $f)) return $FF;
+    if (identical(code, $v)) return $VTAB;
+    if (identical(code, $x)) {
       int value = hexDigitValue(source.next());
       value = value * 16 + hexDigitValue(source.next());
       return value;
     }
-    if (code === $u) {
+    if (identical(code, $u)) {
       int value = 0;
       code = source.next();
-      if (code === $OPEN_CURLY_BRACKET) {
+      if (identical(code, $OPEN_CURLY_BRACKET)) {
         for (code = source.next();
              code != $CLOSE_CURLY_BRACKET;
              code = source.next()) {
diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart
index d241628..0024c59 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -81,10 +81,10 @@
 
 Token firstBeginToken(Node first, Node second) {
   Token token = null;
-  if (first !== null) {
+  if (first != null) {
     token = first.getBeginToken();
   }
-  if (token === null && second !== null) {
+  if (token == null && second != null) {
     // [token] might be null even when [first] is not, e.g. for empty Modifiers.
     token = second.getBeginToken();
   }
@@ -225,14 +225,14 @@
   accept(Visitor visitor) => visitor.visitClassNode(this);
 
   visitChildren(Visitor visitor) {
-    if (name !== null) name.accept(visitor);
-    if (typeParameters !== null) typeParameters.accept(visitor);
-    if (superclass !== null) superclass.accept(visitor);
-    if (interfaces !== null) interfaces.accept(visitor);
-    if (body !== null) body.accept(visitor);
+    if (name != null) name.accept(visitor);
+    if (typeParameters != null) typeParameters.accept(visitor);
+    if (superclass != null) superclass.accept(visitor);
+    if (interfaces != null) interfaces.accept(visitor);
+    if (body != null) body.accept(visitor);
   }
 
-  bool get isInterface => beginToken.stringValue === 'interface';
+  bool get isInterface => identical(beginToken.stringValue, 'interface');
 
   bool get isClass => !isInterface;
 
@@ -276,11 +276,11 @@
 
   Send([this.receiver, this.selector, this.argumentsNode]);
   Send.postfix(this.receiver, this.selector, [Node argument = null])
-      : argumentsNode = (argument === null)
+      : argumentsNode = (argument == null)
         ? new Postfix()
         : new Postfix.singleton(argument);
   Send.prefix(this.receiver, this.selector, [Node argument = null])
-      : argumentsNode = (argument === null)
+      : argumentsNode = (argument == null)
         ? new Prefix()
         : new Prefix.singleton(argument);
 
@@ -289,32 +289,32 @@
   accept(Visitor visitor) => visitor.visitSend(this);
 
   visitChildren(Visitor visitor) {
-    if (receiver !== null) receiver.accept(visitor);
-    if (selector !== null) selector.accept(visitor);
-    if (argumentsNode !== null) argumentsNode.accept(visitor);
+    if (receiver != null) receiver.accept(visitor);
+    if (selector != null) selector.accept(visitor);
+    if (argumentsNode != null) argumentsNode.accept(visitor);
   }
 
-  int argumentCount() => (argumentsNode === null) ? -1 : argumentsNode.length();
+  int argumentCount() => (argumentsNode == null) ? -1 : argumentsNode.length();
 
   bool get isSuperCall {
-    return receiver !== null &&
-           receiver.asIdentifier() !== null &&
+    return receiver != null &&
+           receiver.asIdentifier() != null &&
            receiver.asIdentifier().isSuper();
   }
   bool get isOperator => selector is Operator;
-  bool get isPropertyAccess => argumentsNode === null;
-  bool get isFunctionObjectInvocation => selector === null;
+  bool get isPropertyAccess => argumentsNode == null;
+  bool get isFunctionObjectInvocation => selector == null;
   bool get isPrefix => argumentsNode is Prefix;
   bool get isPostfix => argumentsNode is Postfix;
   bool get isCall => !isOperator && !isPropertyAccess;
   bool get isIndex =>
-      isOperator && selector.asOperator().source.stringValue === '[]';
+      isOperator && identical(selector.asOperator().source.stringValue, '[]');
   bool get isLogicalAnd =>
-      isOperator && selector.asOperator().source.stringValue === '&&';
+      isOperator && identical(selector.asOperator().source.stringValue, '&&');
   bool get isLogicalOr =>
-      isOperator && selector.asOperator().source.stringValue === '||';
+      isOperator && identical(selector.asOperator().source.stringValue, '||');
   bool get isParameterCheck =>
-      isOperator && selector.asOperator().source.stringValue === '?';
+      isOperator && identical(selector.asOperator().source.stringValue, '?');
 
   Token getBeginToken() {
     if (isPrefix && !isIndex) return selector.getBeginToken();
@@ -323,19 +323,19 @@
 
   Token getEndToken() {
     if (isPrefix) {
-      if (receiver !== null) return receiver.getEndToken();
-      if (selector !== null) return selector.getEndToken();
+      if (receiver != null) return receiver.getEndToken();
+      if (selector != null) return selector.getEndToken();
       return null;
     }
-    if (!isPostfix && argumentsNode !== null) {
+    if (!isPostfix && argumentsNode != null) {
       return argumentsNode.getEndToken();
     }
-    if (selector !== null) return selector.getEndToken();
+    if (selector != null) return selector.getEndToken();
     return receiver.getBeginToken();
   }
 
   Send copyWithReceiver(Node newReceiver) {
-    assert(receiver === null);
+    assert(receiver == null);
     return new Send(newReceiver, selector, argumentsNode);
   }
 
@@ -357,12 +357,12 @@
 }
 
 class Postfix extends NodeList {
-  Postfix() : super(nodes: const Link<Node>());
+  Postfix() : super(null, const Link<Node>());
   Postfix.singleton(Node argument) : super.singleton(argument);
 }
 
 class Prefix extends NodeList {
-  Prefix() : super(nodes: const Link<Node>());
+  Prefix() : super(null, const Link<Node>());
   Prefix.singleton(Node argument) : super.singleton(argument);
 }
 
@@ -387,11 +387,11 @@
 
   visitChildren(Visitor visitor) {
     super.visitChildren(visitor);
-    if (assignmentOperator !== null) assignmentOperator.accept(visitor);
+    if (assignmentOperator != null) assignmentOperator.accept(visitor);
   }
 
   Send copyWithReceiver(Node newReceiver) {
-    assert(receiver === null);
+    assert(receiver == null);
     return new SendSet(newReceiver, selector, assignmentOperator,
                        argumentsNode);
   }
@@ -419,10 +419,10 @@
   accept(Visitor visitor) => visitor.visitNewExpression(this);
 
   visitChildren(Visitor visitor) {
-    if (send !== null) send.accept(visitor);
+    if (send != null) send.accept(visitor);
   }
 
-  bool isConst() => newToken.stringValue === 'const';
+  bool isConst() => identical(newToken.stringValue, 'const');
 
   Token getBeginToken() => newToken;
 
@@ -456,20 +456,20 @@
   accept(Visitor visitor) => visitor.visitNodeList(this);
 
   visitChildren(Visitor visitor) {
-    if (nodes === null) return;
+    if (nodes == null) return;
     for (Link<Node> link = nodes; !link.isEmpty(); link = link.tail) {
-      if (link.head !== null) link.head.accept(visitor);
+      if (link.head != null) link.head.accept(visitor);
     }
   }
 
   Token getBeginToken() {
-    if (beginToken !== null) return beginToken;
-     if (nodes !== null) {
+    if (beginToken != null) return beginToken;
+     if (nodes != null) {
        for (Link<Node> link = nodes; !link.isEmpty(); link = link.tail) {
-         if (link.head.getBeginToken() !== null) {
+         if (link.head.getBeginToken() != null) {
            return link.head.getBeginToken();
          }
-         if (link.head.getEndToken() !== null) {
+         if (link.head.getEndToken() != null) {
            return link.head.getEndToken();
          }
        }
@@ -478,13 +478,13 @@
   }
 
   Token getEndToken() {
-    if (endToken !== null) return endToken;
-    if (nodes !== null) {
+    if (endToken != null) return endToken;
+    if (nodes != null) {
       Link<Node> link = nodes;
       if (link.isEmpty()) return beginToken;
       while (!link.tail.isEmpty()) link = link.tail;
-      if (link.head.getEndToken() !== null) return link.head.getEndToken();
-      if (link.head.getBeginToken() !== null) return link.head.getBeginToken();
+      if (link.head.getEndToken() != null) return link.head.getEndToken();
+      if (link.head.getBeginToken() != null) return link.head.getBeginToken();
     }
     return beginToken;
   }
@@ -500,7 +500,7 @@
   accept(Visitor visitor) => visitor.visitBlock(this);
 
   visitChildren(Visitor visitor) {
-    if (statements !== null) statements.accept(visitor);
+    if (statements != null) statements.accept(visitor);
   }
 
   Token getBeginToken() => statements.getBeginToken();
@@ -521,7 +521,7 @@
 
   If asIf() => this;
 
-  bool get hasElsePart => elsePart !== null;
+  bool get hasElsePart => elsePart != null;
 
   void validate() {
     // TODO(ahe): Check that condition has size one.
@@ -530,15 +530,15 @@
   accept(Visitor visitor) => visitor.visitIf(this);
 
   visitChildren(Visitor visitor) {
-    if (condition !== null) condition.accept(visitor);
-    if (thenPart !== null) thenPart.accept(visitor);
-    if (elsePart !== null) elsePart.accept(visitor);
+    if (condition != null) condition.accept(visitor);
+    if (thenPart != null) thenPart.accept(visitor);
+    if (elsePart != null) elsePart.accept(visitor);
   }
 
   Token getBeginToken() => ifToken;
 
   Token getEndToken() {
-    if (elsePart === null) return thenPart.getEndToken();
+    if (elsePart == null) return thenPart.getEndToken();
     return elsePart.getEndToken();
   }
 }
@@ -594,10 +594,10 @@
   accept(Visitor visitor) => visitor.visitFor(this);
 
   visitChildren(Visitor visitor) {
-    if (initializer !== null) initializer.accept(visitor);
-    if (conditionStatement !== null) conditionStatement.accept(visitor);
-    if (update !== null) update.accept(visitor);
-    if (body !== null) body.accept(visitor);
+    if (initializer != null) initializer.accept(visitor);
+    if (conditionStatement != null) conditionStatement.accept(visitor);
+    if (update != null) update.accept(visitor);
+    if (body != null) body.accept(visitor);
   }
 
   Token getBeginToken() => forToken;
@@ -641,7 +641,7 @@
 
   FunctionExpression(this.name, this.parameters, this.body, this.returnType,
                      this.modifiers, this.initializers, this.getOrSet) {
-    assert(modifiers !== null);
+    assert(modifiers != null);
   }
 
   FunctionExpression asFunctionExpression() => this;
@@ -649,33 +649,33 @@
   accept(Visitor visitor) => visitor.visitFunctionExpression(this);
 
   visitChildren(Visitor visitor) {
-    if (modifiers !== null) modifiers.accept(visitor);
-    if (returnType !== null) returnType.accept(visitor);
-    if (name !== null) name.accept(visitor);
-    if (parameters !== null) parameters.accept(visitor);
-    if (initializers !== null) initializers.accept(visitor);
-    if (body !== null) body.accept(visitor);
+    if (modifiers != null) modifiers.accept(visitor);
+    if (returnType != null) returnType.accept(visitor);
+    if (name != null) name.accept(visitor);
+    if (parameters != null) parameters.accept(visitor);
+    if (initializers != null) initializers.accept(visitor);
+    if (body != null) body.accept(visitor);
   }
 
   bool hasBody() {
     // TODO(karlklose,ahe): refactor AST nodes (issue 1713).
-    if (body.asReturn() !== null) return true;
+    if (body.asReturn() != null) return true;
     NodeList statements = body.asBlock().statements;
     return (!statements.nodes.isEmpty() ||
-            statements.getBeginToken().kind !== $SEMICOLON);
+            !identical(statements.getBeginToken().kind, $SEMICOLON));
   }
 
   Token getBeginToken() {
     Token token = firstBeginToken(modifiers, returnType);
-    if (token !== null) return token;
-    if (getOrSet !== null) return getOrSet;
+    if (token != null) return token;
+    if (getOrSet != null) return getOrSet;
     return firstBeginToken(name, parameters);
   }
 
   Token getEndToken() {
-    Token token = (body === null) ? null : body.getEndToken();
-    token = (token === null) ? parameters.getEndToken() : token;
-    return (token === null) ? name.getEndToken() : token;
+    Token token = (body == null) ? null : body.getEndToken();
+    token = (token == null) ? parameters.getEndToken() : token;
+    return (token == null) ? name.getEndToken() : token;
   }
 }
 
@@ -704,7 +704,7 @@
   int get value {
     try {
       Token valueToken = token;
-      if (valueToken.kind === PLUS_TOKEN) valueToken = valueToken.next;
+      if (identical(valueToken.kind, PLUS_TOKEN)) valueToken = valueToken.next;
       return parseInt(valueToken.value.slowToString());
     } on FormatException catch (ex) {
       (this.handler)(token, ex);
@@ -723,7 +723,7 @@
   double get value {
     try {
       Token valueToken = token;
-      if (valueToken.kind === PLUS_TOKEN) valueToken = valueToken.next;
+      if (identical(valueToken.kind, PLUS_TOKEN)) valueToken = valueToken.next;
       return parseDouble(valueToken.value.slowToString());
     } on FormatException catch (ex) {
       (this.handler)(token, ex);
@@ -739,8 +739,8 @@
   LiteralBool asLiteralBool() => this;
 
   bool get value {
-    if (token.stringValue === 'true') return true;
-    if (token.stringValue === 'false') return false;
+    if (identical(token.stringValue, 'true')) return true;
+    if (identical(token.stringValue, 'false')) return false;
     (this.handler)(token, "not a bool ${token.value}");
   }
 
@@ -804,16 +804,16 @@
   final bool raw;
   final int leftQuoteCharCount;
   final int quote;
-  const StringQuoting(this.quote, [bool raw, int leftQuoteLength])
+  const StringQuoting(this.quote, {bool raw, int leftQuoteLength})
       : this.raw = raw, this.leftQuoteCharCount = leftQuoteLength;
-  String get quoteChar => quote === $DQ ? '"' : "'";
+  String get quoteChar => identical(quote, $DQ) ? '"' : "'";
 
   int get leftQuoteLength => (raw ? 1 : 0) + leftQuoteCharCount;
   int get rightQuoteLength => (leftQuoteCharCount > 2) ? 3 : 1;
   static StringQuoting getQuoting(int quote, bool raw, int quoteLength) {
     int index = quoteLength - 1;
     if (quoteLength > 2) index -= 1;
-    return mapping[(raw ? 1 : 0) + index * 2 + (quote === $SQ ? 8 : 0)];
+    return mapping[(raw ? 1 : 0) + index * 2 + (identical(quote, $SQ) ? 8 : 0)];
   }
 }
 
@@ -839,7 +839,7 @@
   void visitChildren(Visitor visitor) {}
 
   bool get isInterpolation => false;
-  bool isValidated() => dartString !== null;
+  bool isValidated() => dartString != null;
 
   Token getBeginToken() => token;
   Token getEndToken() => token;
@@ -865,18 +865,18 @@
 
   LiteralList(this.typeArguments, this.elements, this.constKeyword);
 
-  bool isConst() => constKeyword !== null;
+  bool isConst() => constKeyword != null;
 
   LiteralList asLiteralList() => this;
   accept(Visitor visitor) => visitor.visitLiteralList(this);
 
   visitChildren(Visitor visitor) {
-    if (typeArguments !== null) typeArguments.accept(visitor);
+    if (typeArguments != null) typeArguments.accept(visitor);
     elements.accept(visitor);
   }
 
   Token getBeginToken() {
-    if (constKeyword !== null) return constKeyword;
+    if (constKeyword != null) return constKeyword;
     return firstBeginToken(typeArguments, elements);
   }
 
@@ -890,9 +890,9 @@
 
   Identifier(Token this.token);
 
-  bool isThis() => source.stringValue === 'this';
+  bool isThis() => identical(source.stringValue, 'this');
 
-  bool isSuper() => source.stringValue === 'super';
+  bool isSuper() => identical(source.stringValue, 'super');
 
   Identifier asIdentifier() => this;
 
@@ -922,20 +922,20 @@
 
   Return asReturn() => this;
 
-  bool get hasExpression => expression !== null;
+  bool get hasExpression => expression != null;
 
-  bool get isRedirectingConstructorBody => beginToken.stringValue == '=';
+  bool get isRedirectingFactoryBody => beginToken.stringValue == '=';
 
   accept(Visitor visitor) => visitor.visitReturn(this);
 
   visitChildren(Visitor visitor) {
-    if (expression !== null) expression.accept(visitor);
+    if (expression != null) expression.accept(visitor);
   }
 
   Token getBeginToken() => beginToken;
 
   Token getEndToken() {
-    if (endToken === null) return expression.getEndToken();
+    if (endToken == null) return expression.getEndToken();
     return endToken;
   }
 }
@@ -951,7 +951,7 @@
   accept(Visitor visitor) => visitor.visitExpressionStatement(this);
 
   visitChildren(Visitor visitor) {
-    if (expression !== null) expression.accept(visitor);
+    if (expression != null) expression.accept(visitor);
   }
 
   Token getBeginToken() => expression.getBeginToken();
@@ -972,7 +972,7 @@
   accept(Visitor visitor) => visitor.visitThrow(this);
 
   visitChildren(Visitor visitor) {
-    if (expression !== null) expression.accept(visitor);
+    if (expression != null) expression.accept(visitor);
   }
 
   Token getBeginToken() => throwToken;
@@ -992,7 +992,7 @@
 
   visitChildren(Visitor visitor) {
     typeName.accept(visitor);
-    if (typeArguments !== null) typeArguments.accept(visitor);
+    if (typeArguments != null) typeArguments.accept(visitor);
   }
 
   Token getBeginToken() => typeName.getBeginToken();
@@ -1009,7 +1009,7 @@
 
   visitChildren(Visitor visitor) {
     name.accept(visitor);
-    if (bound !== null) {
+    if (bound != null) {
       bound.accept(visitor);
     }
   }
@@ -1019,7 +1019,7 @@
   Token getBeginToken() => name.getBeginToken();
 
   Token getEndToken() {
-    return (bound !== null) ? bound.getEndToken() : name.getEndToken();
+    return (bound != null) ? bound.getEndToken() : name.getEndToken();
   }
 }
 
@@ -1030,7 +1030,7 @@
   final NodeList definitions;
   VariableDefinitions(this.type, this.modifiers, this.definitions,
                       this.endToken) {
-    assert(modifiers !== null);
+    assert(modifiers != null);
   }
 
   VariableDefinitions asVariableDefinitions() => this;
@@ -1038,13 +1038,13 @@
   accept(Visitor visitor) => visitor.visitVariableDefinitions(this);
 
   visitChildren(Visitor visitor) {
-    if (type !== null) type.accept(visitor);
-    if (definitions !== null) definitions.accept(visitor);
+    if (type != null) type.accept(visitor);
+    if (definitions != null) definitions.accept(visitor);
   }
 
   Token getBeginToken() {
     var token = firstBeginToken(modifiers, type);
-    if (token === null) {
+    if (token == null) {
       token = definitions.getBeginToken();
     }
     return token;
@@ -1078,8 +1078,8 @@
   accept(Visitor visitor) => visitor.visitDoWhile(this);
 
   visitChildren(Visitor visitor) {
-    if (condition !== null) condition.accept(visitor);
-    if (body !== null) body.accept(visitor);
+    if (condition != null) condition.accept(visitor);
+    if (body != null) body.accept(visitor);
   }
 
   Token getBeginToken() => doKeyword;
@@ -1099,8 +1099,8 @@
   accept(Visitor visitor) => visitor.visitWhile(this);
 
   visitChildren(Visitor visitor) {
-    if (condition !== null) condition.accept(visitor);
-    if (body !== null) body.accept(visitor);
+    if (condition != null) condition.accept(visitor);
+    if (body != null) body.accept(visitor);
   }
 
   Token getBeginToken() => whileKeyword;
@@ -1120,7 +1120,7 @@
   accept(Visitor visitor) => visitor.visitParenthesizedExpression(this);
 
   visitChildren(Visitor visitor) {
-    if (expression !== null) expression.accept(visitor);
+    if (expression != null) expression.accept(visitor);
   }
 
   Token getBeginToken() => beginToken;
@@ -1162,13 +1162,13 @@
     int flags = 0;
     for (; !nodes.isEmpty(); nodes = nodes.tail) {
       String value = nodes.head.asIdentifier().source.stringValue;
-      if (value === 'static') flags |= FLAG_STATIC;
-      else if (value === 'abstract') flags |= FLAG_ABSTRACT;
-      else if (value === 'final') flags |= FLAG_FINAL;
-      else if (value === 'var') flags |= FLAG_VAR;
-      else if (value === 'const') flags |= FLAG_CONST;
-      else if (value === 'factory') flags |= FLAG_FACTORY;
-      else if (value === 'external') flags |= FLAG_EXTERNAL;
+      if (identical(value, 'static')) flags |= FLAG_STATIC;
+      else if (identical(value, 'abstract')) flags |= FLAG_ABSTRACT;
+      else if (identical(value, 'final')) flags |= FLAG_FINAL;
+      else if (identical(value, 'var')) flags |= FLAG_VAR;
+      else if (identical(value, 'const')) flags |= FLAG_CONST;
+      else if (identical(value, 'factory')) flags |= FLAG_FACTORY;
+      else if (identical(value, 'external')) flags |= FLAG_EXTERNAL;
       else throw 'internal error: ${nodes.head}';
     }
     return flags;
@@ -1178,7 +1178,7 @@
     Link<Node> nodeList = nodes.nodes;
     for (; !nodeList.isEmpty(); nodeList = nodeList.tail) {
       String value = nodeList.head.asIdentifier().source.stringValue;
-      if(value === modifier) {
+      if(identical(value, modifier)) {
         return nodeList.head;
       }
     }
@@ -1290,7 +1290,7 @@
   StringJuxtaposition asStringJuxtaposition() => this;
 
   bool get isInterpolation {
-    if (isInterpolationCache === null) {
+    if (isInterpolationCache == null) {
       isInterpolationCache = (first.accept(const IsInterpolationVisitor()) ||
                           second.accept(const IsInterpolationVisitor()));
     }
@@ -1307,10 +1307,10 @@
       throw new NodeAssertionFailure(this,
                                      "Getting dartString on interpolation;");
     }
-    if (dartStringCache === null) {
+    if (dartStringCache == null) {
       DartString firstString = first.accept(const GetDartStringVisitor());
       DartString secondString = second.accept(const GetDartStringVisitor());
-      if (firstString === null || secondString === null) {
+      if (firstString == null || secondString == null) {
         return null;
       }
       dartStringCache = new DartString.concat(firstString, secondString);
@@ -1354,7 +1354,7 @@
 
   LiteralMap(this.typeArguments, this.entries, this.constKeyword);
 
-  bool isConst() => constKeyword !== null;
+  bool isConst() => constKeyword != null;
 
   LiteralMap asLiteralMap() => this;
 
@@ -1366,7 +1366,7 @@
   }
 
   Token getBeginToken() {
-    if (constKeyword !== null) return constKeyword;
+    if (constKeyword != null) return constKeyword;
     return firstBeginToken(typeArguments, entries);
   }
 
@@ -1478,7 +1478,7 @@
 
   SwitchCase asSwitchCase() => this;
 
-  bool get isDefaultCase => defaultKeyword !== null;
+  bool get isDefaultCase => defaultKeyword != null;
 
   bool isValidContinueTarget() => true;
 
@@ -1496,7 +1496,7 @@
   Token getEndToken() {
     if (statements.nodes.isEmpty()) {
       // All cases must have at least one expression or be the default.
-      if (defaultKeyword !== null) {
+      if (defaultKeyword != null) {
         // The colon after 'default'.
         return defaultKeyword.next;
       }
@@ -1516,7 +1516,7 @@
   GotoStatement(this.target, this.keywordToken, this.semicolonToken);
 
   visitChildren(Visitor visitor) {
-    if (target !== null) target.accept(visitor);
+    if (target != null) target.accept(visitor);
   }
 
   Token getBeginToken() => keywordToken;
@@ -1639,8 +1639,8 @@
   visitChildren(Visitor visitor) {
     tag.accept(visitor);
     argument.accept(visitor);
-    if (prefixIdentifier !== null) prefixIdentifier.accept(visitor);
-    if (prefix !== null) prefix.accept(visitor);
+    if (prefixIdentifier != null) prefixIdentifier.accept(visitor);
+    if (prefix != null) prefix.accept(visitor);
   }
 
   Token getBeginToken() => beginToken;
@@ -1650,7 +1650,7 @@
   LibraryTag toLibraryTag() {
     if (isImport()) {
       Identifier prefixNode;
-      if (prefix !== null) {
+      if (prefix != null) {
         SourceString source = prefix.dartString.source;
         Token prefixToken = prefix.getBeginToken();
         Token token = new StringToken.fromSource(IDENTIFIER_INFO, source,
@@ -1734,15 +1734,15 @@
 
   visitChildren(Visitor visitor) {
     uri.accept(visitor);
-    if (prefix !== null) prefix.accept(visitor);
-    if (combinators !== null) combinators.accept(visitor);
+    if (prefix != null) prefix.accept(visitor);
+    if (combinators != null) combinators.accept(visitor);
   }
 
   Token getBeginToken() => importKeyword;
 
   Token getEndToken() {
-    if (combinators !== null) return combinators.getEndToken().next;
-    if (prefix !== null) return prefix.getEndToken().next;
+    if (combinators != null) return combinators.getEndToken().next;
+    if (prefix != null) return prefix.getEndToken().next;
     return uri.getEndToken().next;
   }
 }
@@ -1768,13 +1768,13 @@
 
   visitChildren(Visitor visitor) {
     uri.accept(visitor);
-    if (combinators !== null) combinators.accept(visitor);
+    if (combinators != null) combinators.accept(visitor);
   }
 
   Token getBeginToken() => exportKeyword;
 
   Token getEndToken() {
-    if (combinators !== null) return combinators.getEndToken().next;
+    if (combinators != null) return combinators.getEndToken().next;
     return uri.getEndToken().next;
   }
 }
@@ -1828,9 +1828,9 @@
 
   Combinator(this.identifiers, this.keywordToken);
 
-  bool get isShow => keywordToken.stringValue === 'show';
+  bool get isShow => identical(keywordToken.stringValue, 'show');
 
-  bool get isHide => keywordToken.stringValue === 'hide';
+  bool get isHide => identical(keywordToken.stringValue, 'hide');
 
   Combinator asCombinator() => this;
 
@@ -1860,9 +1860,9 @@
   accept(Visitor visitor) => visitor.visitTypedef(this);
 
   visitChildren(Visitor visitor) {
-    if (returnType !== null) returnType.accept(visitor);
+    if (returnType != null) returnType.accept(visitor);
     name.accept(visitor);
-    if (typeParameters !== null) typeParameters.accept(visitor);
+    if (typeParameters != null) typeParameters.accept(visitor);
     formals.accept(visitor);
   }
 
@@ -1889,13 +1889,13 @@
   visitChildren(Visitor visitor) {
     tryBlock.accept(visitor);
     catchBlocks.accept(visitor);
-    if (finallyBlock !== null) finallyBlock.accept(visitor);
+    if (finallyBlock != null) finallyBlock.accept(visitor);
   }
 
   Token getBeginToken() => tryKeyword;
 
   Token getEndToken() {
-    if (finallyBlock !== null) return finallyBlock.getEndToken();
+    if (finallyBlock != null) return finallyBlock.getEndToken();
     if (!catchBlocks.isEmpty()) return catchBlocks.getEndToken();
     return tryBlock.getEndToken();
   }
@@ -1950,13 +1950,13 @@
   accept(Visitor visitor) => visitor.visitCatchBlock(this);
 
   Node get exception {
-    if (formals === null || formals.nodes.isEmpty()) return null;
+    if (formals == null || formals.nodes.isEmpty()) return null;
     VariableDefinitions declarations = formals.nodes.head;
     return declarations.definitions.nodes.head;
   }
 
   Node get trace {
-    if (formals === null || formals.nodes.isEmpty()) return null;
+    if (formals == null || formals.nodes.isEmpty()) return null;
     Link<Node> declarations = formals.nodes.tail;
     if (declarations.isEmpty()) return null;
     VariableDefinitions head = declarations.head;
@@ -1964,8 +1964,8 @@
   }
 
   visitChildren(Visitor visitor) {
-    if (type !== null) type.accept(visitor);
-    if (formals !== null) formals.accept(visitor);
+    if (type != null) type.accept(visitor);
+    if (formals != null) formals.accept(visitor);
     block.accept(visitor);
   }
 
@@ -1976,23 +1976,23 @@
 
 class Initializers {
   static bool isSuperConstructorCall(Send node) {
-    return (node.receiver === null &&
-            node.selector.asIdentifier() !== null &&
+    return (node.receiver == null &&
+            node.selector.asIdentifier() != null &&
             node.selector.asIdentifier().isSuper()) ||
-           (node.receiver !== null &&
-            node.receiver.asIdentifier() !== null &&
+           (node.receiver != null &&
+            node.receiver.asIdentifier() != null &&
             node.receiver.asIdentifier().isSuper() &&
-            node.selector.asIdentifier() !== null);
+            node.selector.asIdentifier() != null);
   }
 
   static bool isConstructorRedirect(Send node) {
-    return (node.receiver === null &&
-            node.selector.asIdentifier() !== null &&
+    return (node.receiver == null &&
+            node.selector.asIdentifier() != null &&
             node.selector.asIdentifier().isThis()) ||
-           (node.receiver !== null &&
-            node.receiver.asIdentifier() !== null &&
+           (node.receiver != null &&
+            node.receiver.asIdentifier() != null &&
             node.receiver.asIdentifier().isThis() &&
-            node.selector.asIdentifier() !== null);
+            node.selector.asIdentifier() != null);
   }
 }
 
@@ -2022,5 +2022,5 @@
  */
 initializerDo(Node node, f(Node node)) {
   SendSet send = node.asSendSet();
-  if (send !== null) return f(send.arguments.head);
+  if (send != null) return f(send.arguments.head);
 }
diff --git a/lib/compiler/implementation/tree/prettyprint.dart b/lib/compiler/implementation/tree/prettyprint.dart
index 81886a8..7f4470a 100644
--- a/lib/compiler/implementation/tree/prettyprint.dart
+++ b/lib/compiler/implementation/tree/prettyprint.dart
@@ -50,7 +50,7 @@
    * of given node.
    */
   void openNode(Node node, String type, [Map params]) {
-    if (params === null) params = new Map();
+    if (params == null) params = new Map();
     addCurrentIndent();
     sb.add("<");
     addBeginAndEndTokensToParams(node, params);
@@ -63,7 +63,7 @@
    * Adds given node to result string.
    */
   void openAndCloseNode(Node node, String type, [Map params]) {
-    if (params === null) params = new Map();
+    if (params == null) params = new Map();
     addCurrentIndent();
     sb.add("<");
     addBeginAndEndTokensToParams(node, params);
@@ -83,11 +83,11 @@
   }
 
   void addTypeWithParams(String type, [Map params]) {
-    if (params === null) params = new Map();
+    if (params == null) params = new Map();
     sb.add("${type}");
     params.forEach((k, v) {
       String value;
-      if (v !== null) {
+      if (v != null) {
         value = v
             .replaceAll("<", "&lt;")
             .replaceAll(">", "&gt;")
@@ -233,7 +233,7 @@
   }
 
   /** Returns token string value or [null] if token is [null]. */
-  tokenToStringOrNull(Token token) => token === null ? null : token.stringValue;
+  tokenToStringOrNull(Token token) => token == null ? null : token.stringValue;
 
   visitLiteralList(LiteralList node) {
     openNode(node, "LiteralList", {
@@ -276,7 +276,7 @@
   visitNodeList(NodeList node) {
     var params = {
         "delimiter" :
-            node.delimiter !== null ? node.delimiter.stringValue : null
+            node.delimiter != null ? node.delimiter.stringValue : null
     };
     if (node.nodes.toList().length == 0) {
       openAndCloseNode(node, "NodeList", params);
@@ -306,7 +306,7 @@
   }
 
   visitChildNode(Node node, String fieldName) {
-    if (node === null) return;
+    if (node == null) return;
     addCurrentIndent();
     sb.add("<$fieldName>\n");
     pushTag(fieldName);
diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
index a99854a..4bfd890 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -20,9 +20,10 @@
   }
 
   void addToken(Token token) {
-    if (token === null) return;
+    if (token == null) return;
     add(token.value);
-    if (token.kind === KEYWORD_TOKEN || token.kind === IDENTIFIER_TOKEN) {
+    if (identical(token.kind, KEYWORD_TOKEN)
+        || identical(token.kind, IDENTIFIER_TOKEN)) {
       sb.add(' ');
     }
   }
@@ -30,7 +31,7 @@
   unparse(Node node) { visit(node); }
 
   visit(Node node) {
-    if (node !== null) node.accept(this);
+    if (node != null) node.accept(this);
   }
 
   visitBlock(Block node) {
@@ -51,10 +52,10 @@
       addToken(node.beginToken.next);
     }
     visit(node.name);
-    if (node.typeParameters !== null) {
+    if (node.typeParameters != null) {
       visit(node.typeParameters);
     }
-    if (node.extendsKeyword !== null) {
+    if (node.extendsKeyword != null) {
       sb.add(' ');
       addToken(node.extendsKeyword);
       visit(node.superclass);
@@ -63,7 +64,7 @@
       sb.add(' ');
       visit(node.interfaces);
     }
-    if (node.defaultClause !== null) {
+    if (node.defaultClause != null) {
       sb.add(' default ');
       visit(node.defaultClause);
     }
@@ -112,11 +113,11 @@
       visit(node.modifiers);
       sb.add(' ');
     }
-    if (node.returnType !== null) {
+    if (node.returnType != null) {
       visit(node.returnType);
       sb.add(' ');
     }
-    if (node.getOrSet !== null) {
+    if (node.getOrSet != null) {
       add(node.getOrSet.value);
       sb.add(' ');
     }
@@ -134,7 +135,7 @@
       } else {
         visit(send.receiver);
         Identifier identifier = send.selector.asIdentifier();
-        if (identifier.token.kind === KEYWORD_TOKEN) {
+        if (identical(identifier.token.kind, KEYWORD_TOKEN)) {
           sb.add(' ');
         } else if (identifier.source == const SourceString('negate')) {
           // TODO(ahe): Remove special case for negate.
@@ -201,7 +202,7 @@
   }
 
   visitLiteralList(LiteralList node) {
-    if (node.constKeyword !== null) add(node.constKeyword.value);
+    if (node.constKeyword != null) add(node.constKeyword.value);
     visit(node.typeArguments);
     visit(node.elements);
     // If list is empty, emit space after [] to disambiguate cases like []==[].
@@ -215,7 +216,7 @@
    */
   unparseNodeListFrom(NodeList node, Link<Node> from) {
     if (from.isEmpty()) return;
-    String delimiter = (node.delimiter === null) ? "" : "${node.delimiter}";
+    String delimiter = (node.delimiter == null) ? "" : "${node.delimiter}";
     visit(from.head);
     for (Link link = from.tail; !link.isEmpty(); link = link.tail) {
       sb.add(delimiter);
@@ -225,10 +226,10 @@
 
   visitNodeList(NodeList node) {
     addToken(node.beginToken);
-    if (node.nodes !== null) {
+    if (node.nodes != null) {
       unparseNodeListFrom(node, node.nodes);
     }
-    if (node.endToken !== null) add(node.endToken.value);
+    if (node.endToken != null) add(node.endToken.value);
   }
 
   visitOperator(Operator node) {
@@ -236,7 +237,7 @@
   }
 
   visitReturn(Return node) {
-    if (node.isRedirectingConstructorBody) {
+    if (node.isRedirectingFactoryBody) {
       sb.add(' ');
     }
     add(node.beginToken.value);
@@ -244,16 +245,16 @@
       sb.add(' ');
     }
     visit(node.expression);
-    if (node.endToken !== null) add(node.endToken.value);
+    if (node.endToken != null) add(node.endToken.value);
   }
 
-  unparseSendReceiver(Send node, [bool spacesNeeded=false]) {
-    if (node.receiver === null) return;
+  unparseSendReceiver(Send node, {bool spacesNeeded: false}) {
+    if (node.receiver == null) return;
     visit(node.receiver);
     CascadeReceiver asCascadeReceiver = node.receiver.asCascadeReceiver();
-    if (asCascadeReceiver !== null) {
+    if (asCascadeReceiver != null) {
       add(asCascadeReceiver.cascadeOperator.value);
-    } else if (node.selector.asOperator() === null) {
+    } else if (node.selector.asOperator() == null) {
       sb.add('.');
     } else if (spacesNeeded) {
       sb.add(' ');
@@ -262,8 +263,8 @@
 
   visitSend(Send node) {
     Operator op = node.selector.asOperator();
-    String opString = op !== null ? op.source.stringValue : null;
-    bool spacesNeeded = opString === 'is' || opString === 'as';
+    String opString = op != null ? op.source.stringValue : null;
+    bool spacesNeeded = identical(opString, 'is') || identical(opString, 'as');
 
     if (node.isPrefix) visit(node.selector);
     unparseSendReceiver(node, spacesNeeded: spacesNeeded);
@@ -271,9 +272,10 @@
     if (spacesNeeded) sb.add(' ');
     // Also add a space for sequences like x + +1 and y - -y.
     // TODO(ahe): remove case for '+' when we drop the support for it.
-    if (node.argumentsNode != null && (opString === '-' || opString === '+')) {
+    if (node.argumentsNode != null && (identical(opString, '-')
+        || identical(opString, '+'))) {
       Token beginToken = node.argumentsNode.getBeginToken();
-      if (beginToken !== null && beginToken.stringValue === opString) {
+      if (beginToken != null && identical(beginToken.stringValue, opString)) {
         sb.add(' ');
       }
     }
@@ -304,7 +306,7 @@
 
   visitThrow(Throw node) {
     add(node.throwToken.value);
-    if (node.expression !== null) {
+    if (node.expression != null) {
       sb.add(' ');
       visit(node.expression);
     }
@@ -318,7 +320,7 @@
 
   visitTypeVariable(TypeVariable node) {
     visit(node.name);
-    if (node.bound !== null) {
+    if (node.bound != null) {
       sb.add(' extends ');
       visit(node.bound);
     }
@@ -329,7 +331,7 @@
     if (node.modifiers.nodes.length() > 0) {
       sb.add(' ');
     }
-    if (node.type !== null) {
+    if (node.type != null) {
       visit(node.type);
       sb.add(' ');
     }
@@ -378,7 +380,7 @@
 
   visitGotoStatement(GotoStatement node) {
     add(node.keywordToken.value);
-    if (node.target !== null) {
+    if (node.target != null) {
       sb.add(' ');
       visit(node.target);
     }
@@ -415,8 +417,8 @@
   }
 
   visitLiteralMap(LiteralMap node) {
-    if (node.constKeyword !== null) add(node.constKeyword.value);
-    if (node.typeArguments !== null) visit(node.typeArguments);
+    if (node.constKeyword != null) add(node.constKeyword.value);
+    if (node.typeArguments != null) visit(node.typeArguments);
     visit(node.entries);
   }
 
@@ -447,7 +449,7 @@
   }
 
   unparseImportTag(String uri, [String prefix]) {
-    final suffix = prefix === null ? '' : ' as $prefix';
+    final suffix = prefix == null ? '' : ' as $prefix';
     sb.add('import "$uri"$suffix;');
   }
 
@@ -456,7 +458,7 @@
     visit(node.tag);
     sb.add('(');
     visit(node.argument);
-    if (node.prefixIdentifier !== null) {
+    if (node.prefixIdentifier != null) {
       visit(node.prefixIdentifier);
       sb.add(':');
       visit(node.prefix);
@@ -469,7 +471,7 @@
     addToken(node.tryKeyword);
     visit(node.tryBlock);
     visit(node.catchBlocks);
-    if (node.finallyKeyword !== null) {
+    if (node.finallyKeyword != null) {
       addToken(node.finallyKeyword);
       visit(node.finallyBlock);
     }
@@ -484,7 +486,7 @@
 
   visitCatchBlock(CatchBlock node) {
     addToken(node.onKeyword);
-    if (node.type !== null) {
+    if (node.type != null) {
       visit(node.type);
       sb.add(' ');
     }
@@ -495,12 +497,12 @@
 
   visitTypedef(Typedef node) {
     addToken(node.typedefKeyword);
-    if (node.returnType !== null) {
+    if (node.returnType != null) {
       visit(node.returnType);
       sb.add(' ');
     }
     visit(node.name);
-    if (node.typeParameters !== null) {
+    if (node.typeParameters != null) {
       visit(node.typeParameters);
     }
     visit(node.formals);
diff --git a/lib/compiler/implementation/tree_validator.dart b/lib/compiler/implementation/tree_validator.dart
index 2601e01..bef2891 100644
--- a/lib/compiler/implementation/tree_validator.dart
+++ b/lib/compiler/implementation/tree_validator.dart
@@ -39,9 +39,9 @@
     final name = node.assignmentOperator.source.stringValue;
     final arguments = node.arguments;
 
-    expect(node, arguments !== null);
+    expect(node, arguments != null);
     expect(node, selector is Identifier, 'selector is not assignable');
-    if (name === '++' || name === '--') {
+    if (identical(name, '++') || identical(name, '--')) {
       expect(node, node.assignmentOperator is Operator);
       if (node.isIndex) {
         expect(node.arguments.tail.head, node.arguments.tail.isEmpty());
@@ -54,7 +54,7 @@
   }
 
   visitReturn(Return node) {
-    if (!node.isRedirectingConstructorBody && node.hasExpression) {
+    if (!node.isRedirectingFactoryBody && node.hasExpression) {
       // We allow non-expression expressions in Return nodes, but only when
       // using them to hold redirecting factory constructors.
       expect(node, node.expression.asExpression() != null);
@@ -70,7 +70,7 @@
   toString() {
     String nodeString = node.toDebugString();
     String result = 'invalid node: $nodeString';
-    if (message !== null) result = '$result ($message)';
+    if (message != null) result = '$result ($message)';
     return result;
   }
 }
diff --git a/lib/compiler/implementation/typechecker.dart b/lib/compiler/implementation/typechecker.dart
index fbba6f3..33b1dce 100644
--- a/lib/compiler/implementation/typechecker.dart
+++ b/lib/compiler/implementation/typechecker.dart
@@ -66,7 +66,7 @@
 
   bool operator ==(other) {
     if (other is !TypeVariableType) return false;
-    return other.element === element;
+    return identical(other.element, element);
   }
 
   String toString() => name.slowToString();
@@ -89,7 +89,7 @@
 
   /** Combine the information about two control-flow edges that are joined. */
   StatementType join(StatementType other) {
-    return (this === other) ? this : MAYBE_RETURNING;
+    return (identical(this, other)) ? this : MAYBE_RETURNING;
   }
 
   DartType unalias(Compiler compiler) => this;
@@ -153,7 +153,7 @@
 
   bool operator ==(other) {
     if (other is !InterfaceType) return false;
-    if (element !== other.element) return false;
+    if (!identical(element, other.element)) return false;
     return arguments == other.arguments;
   }
 }
@@ -165,7 +165,7 @@
 
   FunctionType(DartType this.returnType, Link<DartType> this.parameterTypes,
                Element this.element) {
-    assert(element === null || invariant(element, element.isDeclaration));
+    assert(element == null || invariant(element, element.isDeclaration));
   }
 
   DartType unalias(Compiler compiler) => this;
@@ -188,8 +188,8 @@
   }
 
   void initializeFrom(FunctionType other) {
-    assert(returnType === null);
-    assert(parameterTypes === null);
+    assert(returnType == null);
+    assert(parameterTypes == null);
     returnType = other.returnType;
     parameterTypes = other.parameterTypes;
   }
@@ -241,7 +241,7 @@
 
   bool operator ==(other) {
     if (other is !TypedefType) return false;
-    if (element !== other.element) return false;
+    if (!identical(element, other.element)) return false;
     return typeArguments == other.typeArguments;
   }
 }
@@ -264,11 +264,11 @@
 
   /** Returns true if t is a subtype of s */
   bool isSubtype(DartType t, DartType s) {
-    if (t === s ||
-        t === dynamicType ||
-        s === dynamicType ||
-        s.element === compiler.objectClass ||
-        t.element === compiler.nullClass) {
+    if (identical(t, s) ||
+        identical(t, dynamicType) ||
+        identical(s, dynamicType) ||
+        identical(s.element, compiler.objectClass) ||
+        identical(t.element, compiler.nullClass)) {
       return true;
     }
     t = t.unalias(compiler);
@@ -279,16 +279,16 @@
     } else if (t is InterfaceType) {
       if (s is !InterfaceType) return false;
       ClassElement tc = t.element;
-      if (tc === s.element) return true;
+      if (identical(tc, s.element)) return true;
       for (Link<DartType> supertypes = tc.allSupertypes;
            supertypes != null && !supertypes.isEmpty();
            supertypes = supertypes.tail) {
         DartType supertype = supertypes.head;
-        if (supertype.element === s.element) return true;
+        if (identical(supertype.element, s.element)) return true;
       }
       return false;
     } else if (t is FunctionType) {
-      if (s.element === compiler.functionClass) return true;
+      if (identical(s.element, compiler.functionClass)) return true;
       if (s is !FunctionType) return false;
       FunctionType tf = t;
       FunctionType sf = s;
@@ -304,7 +304,7 @@
       return true;
     } else if (t is TypeVariableType) {
       if (s is !TypeVariableType) return false;
-      return (t.element === s.element);
+      return (identical(t.element, s.element));
     } else {
       throw 'internal error: unknown type kind';
     }
@@ -351,7 +351,7 @@
 
   DartType fail(node, [reason]) {
     String message = 'cannot type-check';
-    if (reason !== null) {
+    if (reason != null) {
       message = '$message: $reason';
     }
     throw new CancelTypeCheckException(node, message);
@@ -374,7 +374,7 @@
   }
 
   DartType analyzeWithDefault(Node node, DartType defaultValue) {
-    return node !== null ? analyze(node) : defaultValue;
+    return node != null ? analyze(node) : defaultValue;
   }
 
   DartType analyze(Node node) {
@@ -390,7 +390,7 @@
     }
     DartType result = node.accept(this);
     // TODO(karlklose): record type?
-    if (result === null) {
+    if (result == null) {
       fail(node, 'internal error: type is null');
     }
     return result;
@@ -470,8 +470,8 @@
     DartType previousType;
     final FunctionElement element = elements[node];
     if (Elements.isUnresolved(element)) return types.dynamicType;
-    if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR ||
-        element.kind === ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
+    if (identical(element.kind, ElementKind.GENERATIVE_CONSTRUCTOR) ||
+        identical(element.kind, ElementKind.GENERATIVE_CONSTRUCTOR_BODY)) {
       type = types.dynamicType;
       returnType = types.voidType;
     } else {
@@ -521,16 +521,16 @@
   DartType lookupMethodType(Node node, ClassElement classElement,
                         SourceString name) {
     Element member = classElement.lookupLocalMember(name);
-    if (member === null) {
+    if (member == null) {
       classElement.ensureResolved(compiler);
       for (Link<DartType> supertypes = classElement.allSupertypes;
-           !supertypes.isEmpty() && member === null;
+           !supertypes.isEmpty() && member == null;
            supertypes = supertypes.tail) {
         ClassElement lookupTarget = supertypes.head.element;
         member = lookupTarget.lookupLocalMember(name);
       }
     }
-    if (member !== null && member.kind == ElementKind.FUNCTION) {
+    if (member != null && member.kind == ElementKind.FUNCTION) {
       return computeType(member);
     }
     reportTypeWarning(node, MessageKind.METHOD_NOT_FOUND,
@@ -540,7 +540,7 @@
 
   void analyzeArguments(Send send, DartType type) {
     Link<Node> arguments = send.arguments;
-    if (type === null || type === types.dynamicType) {
+    if (type == null || identical(type, types.dynamicType)) {
       while(!arguments.isEmpty()) {
         analyze(arguments.head);
         arguments = arguments.tail;
@@ -574,7 +574,7 @@
     Identifier selector = node.selector.asIdentifier();
     String name = selector.source.stringValue;
 
-    if (node.isOperator && name === 'is') {
+    if (node.isOperator && identical(name, 'is')) {
       analyze(node.receiver);
       return boolType;
     } else if (node.isOperator) {
@@ -585,17 +585,17 @@
       final DartType secondArgumentType =
           analyzeWithDefault(secondArgument, null);
 
-      if (name === '+' || name === '=' || name === '-'
-          || name === '*' || name === '/' || name === '%'
-          || name === '~/' || name === '|' || name ==='&'
-          || name === '^' || name === '~'|| name === '<<'
-          || name === '>>' || name === '[]') {
+      if (identical(name, '+') || identical(name, '=') || identical(name, '-')
+          || identical(name, '*') || identical(name, '/') || identical(name, '%')
+          || identical(name, '~/') || identical(name, '|') || identical(name, '&')
+          || identical(name, '^') || identical(name, '~')|| identical(name, '<<')
+          || identical(name, '>>') || identical(name, '[]')) {
         return types.dynamicType;
-      } else if (name === '<' || name === '>' || name === '<='
-                 || name === '>=' || name === '==' || name === '!='
-                 || name === '===' || name === '!==') {
+      } else if (identical(name, '<') || identical(name, '>') || identical(name, '<=')
+                 || identical(name, '>=') || identical(name, '==') || identical(name, '!=')
+                 || identical(name, '===') || identical(name, '!==')) {
         return boolType;
-      } else if (name === '||' || name === '&&' || name === '!') {
+      } else if (identical(name, '||') || identical(name, '&&') || identical(name, '!')) {
         checkAssignable(firstArgument, boolType, firstArgumentType);
         if (!arguments.isEmpty()) {
           // TODO(karlklose): check number of arguments in validator.
@@ -606,11 +606,11 @@
       fail(selector, 'unexpected operator ${name}');
 
     } else if (node.isPropertyAccess) {
-      if (node.receiver !== null) {
+      if (node.receiver != null) {
         // TODO(karlklose): we cannot handle fields.
         return unhandledExpression();
       }
-      if (element === null) return types.dynamicType;
+      if (element == null) return types.dynamicType;
       return computeType(element);
 
     } else if (node.isFunctionObjectInvocation) {
@@ -618,43 +618,43 @@
 
     } else {
       FunctionType computeFunType() {
-        if (node.receiver !== null) {
+        if (node.receiver != null) {
           DartType receiverType = analyze(node.receiver);
           if (receiverType.element == compiler.dynamicClass) return null;
-          if (receiverType === null) {
+          if (receiverType == null) {
             fail(node.receiver, 'receivertype is null');
           }
-          if (receiverType.element.kind === ElementKind.GETTER) {
+          if (identical(receiverType.element.kind, ElementKind.GETTER)) {
             FunctionType getterType  = receiverType;
             receiverType = getterType.returnType;
           }
           ElementKind receiverKind = receiverType.element.kind;
-          if (receiverKind === ElementKind.TYPEDEF) {
+          if (identical(receiverKind, ElementKind.TYPEDEF)) {
             // TODO(karlklose): handle typedefs.
             return null;
           }
-          if (receiverKind === ElementKind.TYPE_VARIABLE) {
+          if (identical(receiverKind, ElementKind.TYPE_VARIABLE)) {
             // TODO(karlklose): handle type variables.
             return null;
           }
-          if (receiverKind !== ElementKind.CLASS) {
+          if (!identical(receiverKind, ElementKind.CLASS)) {
             fail(node.receiver, 'unexpected receiver kind: ${receiverKind}');
           }
           ClassElement classElement = receiverType.element;
           // TODO(karlklose): substitute type arguments.
           DartType memberType =
             lookupMethodType(selector, classElement, selector.source);
-          if (memberType.element === compiler.dynamicClass) return null;
+          if (identical(memberType.element, compiler.dynamicClass)) return null;
           return memberType;
         } else {
           if (Elements.isUnresolved(element)) {
             fail(node, 'unresolved ${node.selector}');
-          } else if (element.kind === ElementKind.FUNCTION) {
+          } else if (identical(element.kind, ElementKind.FUNCTION)) {
             return computeType(element);
-          } else if (element.kind === ElementKind.FOREIGN) {
+          } else if (identical(element.kind, ElementKind.FOREIGN)) {
             return null;
-          } else if (element.kind === ElementKind.VARIABLE
-                     || element.kind === ElementKind.FIELD) {
+          } else if (identical(element.kind, ElementKind.VARIABLE)
+                     || identical(element.kind, ElementKind.FIELD)) {
             // TODO(karlklose): handle object invocations.
             return null;
           } else {
@@ -664,14 +664,14 @@
       }
       FunctionType funType = computeFunType();
       analyzeArguments(node, funType);
-      return (funType !== null) ? funType.returnType : types.dynamicType;
+      return (funType != null) ? funType.returnType : types.dynamicType;
     }
   }
 
   visitSendSet(SendSet node) {
     Identifier selector = node.selector;
     final name = node.assignmentOperator.source.stringValue;
-    if (name === '++' || name === '--') {
+    if (identical(name, '++') || identical(name, '--')) {
       final Element element = elements[node.selector];
       final DartType receiverType = computeType(element);
       // TODO(karlklose): this should be the return type instead of int.
@@ -747,17 +747,22 @@
 
   /** Dart Programming Language Specification: 11.10 Return */
   DartType visitReturn(Return node) {
-    if (node.getBeginToken().stringValue === 'native') {
+    if (identical(node.getBeginToken().stringValue, 'native')) {
       return StatementType.RETURNING;
     }
+    if (node.isRedirectingFactoryBody) {
+      // TODO(lrn): Typecheck the body. It must refer to the constructor
+      // of a subtype.
+      return elements.getType(node);
+    }
 
     final expression = node.expression;
-    final isVoidFunction = (expectedReturnType === types.voidType);
+    final isVoidFunction = (identical(expectedReturnType, types.voidType));
 
     // Executing a return statement return e; [...] It is a static type warning
     // if the type of e may not be assigned to the declared return type of the
     // immediately enclosing function.
-    if (expression !== null) {
+    if (expression != null) {
       final expressionType = analyze(expression);
       if (isVoidFunction
           && !types.isAssignable(expressionType, types.voidType)) {
@@ -779,14 +784,14 @@
   }
 
   DartType visitThrow(Throw node) {
-    if (node.expression !== null) analyze(node.expression);
+    if (node.expression != null) analyze(node.expression);
     return StatementType.RETURNING;
   }
 
   DartType computeType(Element element) {
     if (Elements.isUnresolved(element)) return types.dynamicType;
     DartType result = element.computeType(compiler);
-    return (result !== null) ? result : types.dynamicType;
+    return (result != null) ? result : types.dynamicType;
   }
 
   DartType visitTypeAnnotation(TypeAnnotation node) {
@@ -820,7 +825,7 @@
     checkCondition(node.condition);
     StatementType bodyType = analyze(node.body);
     Expression cond = node.condition.asParenthesizedExpression().expression;
-    if (cond.asLiteralBool() !== null && cond.asLiteralBool().value == true) {
+    if (cond.asLiteralBool() != null && cond.asLiteralBool().value == true) {
       // If the condition is a constant boolean expression denoting true,
       // control-flow always enters the loop body.
       // TODO(karlklose): this should be StatementType.RETURNING unless there
diff --git a/lib/compiler/implementation/types/concrete_types_inferrer.dart b/lib/compiler/implementation/types/concrete_types_inferrer.dart
index d93cb38..780241d 100644
--- a/lib/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/lib/compiler/implementation/types/concrete_types_inferrer.dart
@@ -31,7 +31,7 @@
 
   ClassBaseType(this.element);
   bool operator ==(BaseType other) {
-    if (this === other) return true;
+    if (identical(this, other)) return true;
     if (other is! ClassBaseType) return false;
     return element == other.element;
   }
@@ -92,7 +92,7 @@
 
   abstract ConcreteType union(ConcreteType other);
   abstract bool isUnkown();
-  abstract Set<BaseType> get baseTypes();
+  abstract Set<BaseType> get baseTypes;
 
   /**
    * Returns the unique element of [: this :] if [: this :] is a singleton,
@@ -107,8 +107,8 @@
 class UnknownConcreteType implements ConcreteType {
   const UnknownConcreteType();
   bool isUnkown() => true;
-  bool operator ==(ConcreteType other) => this === other;
-  Set<BaseType> get baseTypes() =>
+  bool operator ==(ConcreteType other) => identical(this, other);
+  Set<BaseType> get baseTypes =>
       new Set<BaseType>.from([const UnknownBaseType()]);
   int hashCode() => 0;
   ConcreteType union(ConcreteType other) => this;
@@ -251,6 +251,8 @@
   final BaseType doubleBaseType;
   final BaseType boolBaseType;
   final BaseType stringBaseType;
+  final BaseType listBaseType;
+  final BaseType mapBaseType;
   final BaseType objectBaseType;
 
   BaseTypes(Compiler compiler) :
@@ -258,6 +260,8 @@
     doubleBaseType = new ClassBaseType(compiler.doubleClass),
     boolBaseType = new ClassBaseType(compiler.boolClass),
     stringBaseType = new ClassBaseType(compiler.stringClass),
+    listBaseType = new ClassBaseType(compiler.listClass),
+    mapBaseType = new ClassBaseType(compiler.mapClass),
     objectBaseType = new ClassBaseType(compiler.objectClass);
 }
 
@@ -274,7 +278,7 @@
 
   ConcreteType lookupType(Element element) => environment[element];
   ConcreteType lookupTypeOfThis() {
-    return (typeOfThis === null)
+    return (typeOfThis == null)
         ? null
         : new ConcreteType.singleton(typeOfThis);
   }
@@ -317,7 +321,7 @@
   }
 
   int hashCode() {
-    int result = (typeOfThis !== null) ? typeOfThis.hashCode() : 1;
+    int result = (typeOfThis != null) ? typeOfThis.hashCode() : 1;
     environment.forEach((element, concreteType) {
       result = 31 * (31 * result + element.hashCode()) +
           concreteType.hashCode();
@@ -409,7 +413,7 @@
     var result = new List<FunctionElement>();
     for (final cls in compiler.enqueuer.resolution.seenClasses) {
       Element elem = cls.lookupLocalMember(methodName);
-      if (elem !== null) {
+      if (elem != null) {
         result.add(elem);
       }
     }
@@ -441,7 +445,7 @@
    */
   void augmentFieldType(Element field, ConcreteType type) {
     ConcreteType oldType = inferredFieldTypes[field];
-    ConcreteType newType = (oldType !== null)
+    ConcreteType newType = (oldType != null)
         ? oldType.union(type)
         : type;
     if (oldType != newType) {
@@ -450,7 +454,7 @@
       if (fieldReaders != null) {
         for (final reader in fieldReaders) {
           final readerInstances = cache[reader];
-          if (readerInstances !== null) {
+          if (readerInstances != null) {
             readerInstances.forEach((environment, _) {
               workQueue.addLast(new InferenceWorkItem(reader, environment));
             });
@@ -467,7 +471,7 @@
   void augmentParameterType(VariableElement parameter, ConcreteType type) {
     ConcreteType oldType = inferredParameterTypes[parameter];
     inferredParameterTypes[parameter] =
-        (oldType === null) ? type : oldType.union(type);
+        (oldType == null) ? type : oldType.union(type);
   }
 
   /**
@@ -595,7 +599,7 @@
       SourceString source = identifier.source;
       final Element namedParameter = leftOverNamedParameters[source];
       // unexisting or already used named parameter
-      if (namedParameter === null) return null;
+      if (namedParameter == null) return null;
       result[namedParameter] = concreteType;
       leftOverNamedParameters.remove(source);
     };
@@ -615,7 +619,7 @@
       ConcreteTypesEnvironment environment) {
 
     Map<ConcreteTypesEnvironment, ConcreteType> template = cache[function];
-    if (template === null) {
+    if (template == null) {
       template = new Map<ConcreteTypesEnvironment, ConcreteType>();
       cache[function] = template;
     }
@@ -711,7 +715,7 @@
         if (methodCallers == null) continue;
         for (final caller in methodCallers) {
           final callerInstances = cache[caller];
-          if (callerInstances !== null) {
+          if (callerInstances != null) {
             callerInstances.forEach((environment, _) {
               workQueue.addLast(
                   new InferenceWorkItem(caller, environment));
@@ -760,9 +764,8 @@
    * Fail with a message and abort.
    */
   void fail(node, [reason]) {
-    throw "fail: ${node.toDebugString()}";
     String message = 'cannot infer types';
-    if (reason !== null) {
+    if (reason != null) {
       message = '$message: $reason';
     }
     throw new CancelTypeInferenceException(node, message);
@@ -777,7 +780,7 @@
   final List<ConcreteType> positional;
   final Map<Identifier, ConcreteType> named;
   ArgumentsTypes(this.positional, this.named);
-  int get length() => positional.length + named.length;
+  int get length => positional.length + named.length;
   toString() => "{ positional = $positional, named = $named }";
 }
 
@@ -803,7 +806,7 @@
         iterator = iterator.tail) {
       Node node = iterator.head;
       NamedArgument namedArgument = node.asNamedArgument();
-      if (namedArgument !== null) {
+      if (namedArgument != null) {
         named[namedArgument.name] = analyze(namedArgument.expression);
       } else {
         positional.add(analyze(node));
@@ -818,14 +821,14 @@
    * otherwise.
    */
   ConcreteType analyze(Node node) {
-    if (node === null) {
+    if (node == null) {
       final String error = 'internal error: unexpected node: null';
       inferrer.fail(lastSeenNode, error);
     } else {
       lastSeenNode = node;
     }
     ConcreteType result = node.accept(this);
-    if (result === null) {
+    if (result == null) {
       inferrer.fail(node, 'internal error: inferred type is null');
     }
     inferrer.augmentInferredType(node, result);
@@ -872,7 +875,7 @@
   ConcreteType visitIdentifier(Identifier node) {
     if (node.isThis()) {
       ConcreteType result = environment.lookupTypeOfThis();
-      if (result === null) {
+      if (result == null) {
         inferrer.fail(node, '"this" has no type');
       }
       return result;
@@ -898,11 +901,11 @@
   ConcreteType visitSendSet(SendSet node) {
     Identifier selector = node.selector;
     final name = node.assignmentOperator.source.stringValue;
-    if (name === '++' || name === '--') {
+    if (identical(name, '++') || identical(name, '--')) {
       inferrer.fail(node, 'not yet implemented');
     } else {
       Element element = elements[node];
-      if (element !== null) {
+      if (element != null) {
         ConcreteType type = analyze(node.argumentsNode);
         environment = environment.put(elements[node], type);
         if (element.isField()) {
@@ -935,7 +938,7 @@
         } else {
           for (ClassBaseType baseReceiverType in receiverType.baseTypes) {
             Element member = baseReceiverType.element.lookupMember(source);
-            if (member !== null) {
+            if (member != null) {
               augmentField(baseReceiverType, member);
             }
           }
@@ -980,7 +983,8 @@
   }
 
   ConcreteType visitLiteralList(LiteralList node) {
-    inferrer.fail(node, 'not yet implemented');
+    visitNodeList(node.elements);
+    return new ConcreteType.singleton(inferrer.baseTypes.listBaseType);
   }
 
   ConcreteType visitNodeList(NodeList node) {
@@ -997,16 +1001,15 @@
     inferrer.fail(node, 'not yet implemented');
   }
 
-  /** Dart Programming Language Specification: 11.10 Return */
   ConcreteType visitReturn(Return node) {
     final expression = node.expression;
     return (expression === null)
-        ? new ConcreteType.empty()
+        ? new ConcreteType.singleton(const NullBaseType())
         : analyze(expression);
   }
 
   ConcreteType visitThrow(Throw node) {
-    if (node.expression !== null) analyze(node.expression);
+    if (node.expression != null) analyze(node.expression);
     return new ConcreteType.empty();
   }
 
@@ -1073,6 +1076,7 @@
   }
 
   ConcreteType visitContinueStatement(ContinueStatement node) {
+    // TODO(polux): we can be more precise
     return new ConcreteType.empty();
   }
 
@@ -1089,11 +1093,12 @@
   }
 
   ConcreteType visitLiteralMap(LiteralMap node) {
-    inferrer.fail(node, 'not yet implemented');
+    visitNodeList(node.entries);
+    return new ConcreteType.singleton(inferrer.baseTypes.mapBaseType);
   }
 
   ConcreteType visitLiteralMapEntry(LiteralMapEntry node) {
-    inferrer.fail(node, 'not yet implemented');
+    return analyze(node.value);
   }
 
   ConcreteType visitNamedArgument(NamedArgument node) {
@@ -1138,10 +1143,10 @@
 
   ConcreteType visitGetterSend(Send node) {
     Element element = elements[node];
-    if (element !== null) {
+    if (element != null) {
       // node is a local variable or a field of this
       ConcreteType result = environment.lookupType(element);
-      if (result !== null) {
+      if (result != null) {
         // node is a local variable
         return result;
       } else {
@@ -1151,7 +1156,7 @@
       }
     } else {
       // node is a field of not(this)
-      assert(node.receiver !== null);
+      assert(node.receiver != null);
 
       ConcreteType result = new ConcreteType.empty();
       void augmentResult(BaseType baseReceiverType, Element getterOrField) {
@@ -1186,7 +1191,7 @@
             ClassBaseType classBaseType = baseReceiverType;
             Element getterOrField = classBaseType.element
                 .lookupMember(node.selector.asIdentifier().source);
-            if (getterOrField !== null) {
+            if (getterOrField != null) {
               augmentResult(baseReceiverType, getterOrField);
             }
           }
@@ -1221,7 +1226,7 @@
         if (!baseReceiverType.isNull()) {
           FunctionElement method = (baseReceiverType as ClassBaseType).element
               .lookupMember(node.selector.asIdentifier().source);
-          if (method !== null) {
+          if (method != null) {
             inferrer.addCaller(method, currentMethod);
             result = result.union(inferrer.getSendReturnType(method,
                 baseReceiverType, argumentsTypes));
@@ -1243,7 +1248,7 @@
         analyzeArguments(node.arguments));
   }
 
-  void internalError(String reason, [Node node]) {
+  void internalError(String reason, {Node node}) {
     inferrer.fail(node, reason);
   }
 }
diff --git a/lib/compiler/implementation/types/types.dart b/lib/compiler/implementation/types/types.dart
index ca44c69..428102b 100644
--- a/lib/compiler/implementation/types/types.dart
+++ b/lib/compiler/implementation/types/types.dart
@@ -2,16 +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.
 
-#library('types');
+library types;
 
-#import('../leg.dart');
-#import('../tree/tree.dart');
-#import('../elements/elements.dart');
-#import('../util/util.dart');
-#import('../scanner/scannerlib.dart');
-#import('../universe/universe.dart');
+import '../dart2jslib.dart' hide Selector;
+import '../tree/tree.dart';
+import '../elements/elements.dart';
+import '../util/util.dart';
+import '../universe/universe.dart';
 
-#source('concrete_types_inferrer.dart');
+part 'concrete_types_inferrer.dart';
 
 /**
  * The types task infers guaranteed types globally.
@@ -63,7 +62,7 @@
       }
       Element holder = element.enclosingElement;
       Link<Element> types = typedSends[holder];
-      if (types === null) return null;
+      if (types == null) return null;
       if (!holder.isFunction()) return null;
       if (untypedElements.contains(holder)) return null;
       FunctionElement function = holder;
@@ -165,15 +164,15 @@
   }
 
   Link<Element> computeConcreteSendArguments(Send node) {
-    if (node.argumentsNode === null) return null;
+    if (node.argumentsNode == null) return null;
     if (node.arguments.isEmpty()) return const Link<Element>();
-    if (node.receiver !== null && concreteTypes[node.receiver] === null) {
+    if (node.receiver != null && concreteTypes[node.receiver] == null) {
       return null;
     }
     LinkBuilder<Element> types = new LinkBuilder<Element>();
     for (Node argument in node.arguments) {
       Element type = concreteTypes[argument];
-      if (type === null) return null;
+      if (type == null) return null;
       types.addLast(type);
     }
     return types.toLink();
@@ -182,22 +181,22 @@
   visitSend(Send node) {
     node.visitChildren(this);
     Element element = elements[node.selector];
-    if (element === null) return;
+    if (element == null) return;
     if (!Elements.isStaticOrTopLevelFunction(element)) return;
-    if (node.argumentsNode === null) {
+    if (node.argumentsNode == null) {
       // interest(node, 'closurized method');
       task.untypedElements.add(element);
       return;
     }
     Link<Element> types = computeConcreteSendArguments(node);
-    if (types !== null) {
+    if (types != null) {
       Link<Element> existing = task.typedSends[element];
-      if (existing === null) {
+      if (existing == null) {
         task.typedSends[element] = types;
       } else {
         // interest(node, 'multiple invocations');
         Link<Element> lub = computeLubs(existing, types);
-        if (lub === null) {
+        if (lub == null) {
           task.untypedElements.add(element);
         } else {
           task.typedSends[element] = lub;
@@ -229,7 +228,7 @@
     LinkBuilder<Element> lubs = new LinkBuilder<Element>();
     while (!a.isEmpty() && !b.isEmpty()) {
       Element lub = computeLub(a.head, b.head);
-      if (lub === null) return null;
+      if (lub == null) return null;
       lubs.addLast(lub);
       a = a.tail;
       b = b.tail;
@@ -243,7 +242,7 @@
    */
   Element computeLub(Element a, Element b) {
     // Fast common case, but also simple initial implementation.
-    if (a === b) return a;
+    if (identical(a, b)) return a;
 
     // TODO(ahe): Improve the following "computation"...
     return null;
diff --git a/lib/compiler/implementation/universe/function_set.dart b/lib/compiler/implementation/universe/function_set.dart
index 9dfdc76..8dd7d58 100644
--- a/lib/compiler/implementation/universe/function_set.dart
+++ b/lib/compiler/implementation/universe/function_set.dart
@@ -23,14 +23,14 @@
   void remove(Element element) {
     assert(element.isMember());
     FunctionSetNode node = findNode(element.getEnclosingClass(), false);
-    if (node !== null) node.membersByName.remove(element.name);
+    if (node != null) node.membersByName.remove(element.name);
   }
 
   // TODO(kasperl): Allow static members too?
   bool contains(Element element) {
     assert(element.isMember());
     FunctionSetNode node = findNode(element.getEnclosingClass(), false);
-    return (node !== null)
+    return (node != null)
         ? node.membersByName.containsKey(element.name)
         : false;
   }
@@ -60,12 +60,12 @@
 
   Set<Element> filterAllBySelector(Selector selector) {
     Set<Element> result = new Set<Element>();
-    if (root === null) return result;
+    if (root == null) return result;
     root.visitRecursively((FunctionSetNode node) {
       Element member = node.membersByName[selector.name];
       // Since we're running through the entire tree we have to use
       // the applies method that takes types into account.
-      if (member !== null && selector.applies(member, compiler)) {
+      if (member != null && selector.applies(member, compiler)) {
         result.add(member);
       }
       return true;
@@ -75,10 +75,10 @@
 
   Set<Element> filterHierarchyBySelector(Selector selector) {
     Set<Element> result = new Set<Element>();
-    if (root === null) return result;
+    if (root == null) return result;
     visitHierarchy(selectorType(selector), (FunctionSetNode node) {
       Element member = node.membersByName[selector.name];
-      if (member !== null && selector.appliesUntyped(member, compiler)) {
+      if (member != null && selector.appliesUntyped(member, compiler)) {
         result.add(member);
       }
       return true;
@@ -88,12 +88,12 @@
 
   bool hasAnyInAll(Selector selector) {
     bool result = false;
-    if (root === null) return result;
+    if (root == null) return result;
     root.visitRecursively((FunctionSetNode node) {
       Element member = node.membersByName[selector.name];
       // Since we're running through the entire tree we have to use
       // the applies method that takes types into account.
-      if (member !== null && selector.applies(member, compiler)) {
+      if (member != null && selector.applies(member, compiler)) {
         result = true;
         // End the traversal.
         return false;
@@ -105,10 +105,10 @@
 
   bool hasAnyInHierarchy(Selector selector) {
     bool result = false;
-    if (root === null) return result;
+    if (root == null) return result;
     visitHierarchy(selectorType(selector), (FunctionSetNode node) {
       Element member = node.membersByName[selector.name];
-      if (member !== null && selector.appliesUntyped(member, compiler)) {
+      if (member != null && selector.appliesUntyped(member, compiler)) {
         result = true;
         // End the traversal.
         return false;
@@ -119,7 +119,7 @@
   }
 
   void forEach(Function f) {
-    if (root === null) return;
+    if (root == null) return;
     root.visitRecursively((FunctionSetNode node) {
       node.membersByName.forEach(
           (SourceString _, Element element) => f(element));
diff --git a/lib/compiler/implementation/universe/partial_type_tree.dart b/lib/compiler/implementation/universe/partial_type_tree.dart
index 7cc1512..721585f 100644
--- a/lib/compiler/implementation/universe/partial_type_tree.dart
+++ b/lib/compiler/implementation/universe/partial_type_tree.dart
@@ -61,7 +61,7 @@
   // TODO(kasperl): Move this to the Selector class?
   ClassElement selectorType(Selector selector) {
     DartType type = selector.receiverType;
-    return (type !== null) ? type.element : compiler.objectClass;
+    return (type != null) ? type.element : compiler.objectClass;
   }
 
   /**
@@ -71,13 +71,13 @@
    * return null if we cannot find a node that matches the [type].
    */
   PartialTypeTreeNode findNode(ClassElement type, bool insert) {
-    if (root === null) {
+    if (root == null) {
       if (!insert) return null;
       root = newNode(compiler.objectClass);
     }
 
     PartialTypeTreeNode current = root;
-    L: while (current.type !== type) {
+    L: while (!identical(current.type, type)) {
       assert(type.isSubclassOf(current.type));
 
       // Run through the children. If we find a subtype of the type
@@ -123,7 +123,7 @@
     }
 
     // We found an exact match. No need to insert new nodes.
-    assert(current.type === type);
+    assert(identical(current.type, type));
     return current;
   }
 
@@ -134,7 +134,7 @@
   void visitHierarchy(ClassElement type, bool visit(PartialTypeTreeNode node)) {
     assert(!containsInterfaceSubtypes);
     PartialTypeTreeNode current = root;
-    L: while (current.type !== type) {
+    L: while (!identical(current.type, type)) {
       assert(type.isSubclassOf(current.type));
       if (!visit(current)) return;
       for (Link link = current.children; !link.isEmpty(); link = link.tail) {
diff --git a/lib/compiler/implementation/universe/selector_map.dart b/lib/compiler/implementation/universe/selector_map.dart
index 148c86b..b5aa0d2 100644
--- a/lib/compiler/implementation/universe/selector_map.dart
+++ b/lib/compiler/implementation/universe/selector_map.dart
@@ -11,9 +11,9 @@
 
   T operator [](Selector selector) {
     SelectorMapNode<T> node = findNode(selectorType(selector), false);
-    if (node === null) return null;
+    if (node == null) return null;
     Link<SelectorValue<T>> selectors = node.selectorsByName[selector.name];
-    if (selectors === null) return null;
+    if (selectors == null) return null;
     for (Link link = selectors; !link.isEmpty(); link = link.tail) {
       SelectorValue<T> existing = link.head;
       if (existing.selector.equalsUntyped(selector)) return existing.value;
@@ -24,7 +24,7 @@
   void operator []=(Selector selector, T value) {
     SelectorMapNode<T> node = findNode(selectorType(selector), true);
     Link<SelectorValue<T>> selectors = node.selectorsByName[selector.name];
-    if (selectors === null) {
+    if (selectors == null) {
       // No existing selectors with the given name. Create a new
       // linked list.
       SelectorValue<T> head = new SelectorValue<T>(selector, value);
@@ -52,9 +52,9 @@
   // TODO(kasperl): Share code with the [] operator?
   bool containsKey(Selector selector) {
     SelectorMapNode<T> node = findNode(selectorType(selector), false);
-    if (node === null) return false;
+    if (node == null) return false;
     Link<SelectorValue<T>> selectors = node.selectorsByName[selector.name];
-    if (selectors === null) return false;
+    if (selectors == null) return false;
     for (Link link = selectors; !link.isEmpty(); link = link.tail) {
       SelectorValue<T> existing = link.head;
       if (existing.selector.equalsUntyped(selector)) return true;
@@ -69,7 +69,7 @@
    */
   void visitMatching(Element member, bool visit(Selector selector, T value)) {
     assert(member.isMember());
-    if (root === null) return;
+    if (root == null) return;
     // TODO(kasperl): For now, we use a different implementation for
     // visiting if the tree contains interface subtypes.
     if (containsInterfaceSubtypes) {
@@ -82,7 +82,7 @@
   void visitAllMatching(Element member, bool visit(selector, value)) {
     root.visitRecursively((SelectorMapNode<T> node) {
       Link<SelectorValue<T>> selectors = node.selectorsByName[member.name];
-      if (selectors === null) return true;
+      if (selectors == null) return true;
       for (Link link = selectors; !link.isEmpty(); link = link.tail) {
         SelectorValue<T> existing = link.head;
         Selector selector = existing.selector;
@@ -99,7 +99,7 @@
   void visitHierarchyMatching(Element member, bool visit(selector, value)) {
     visitHierarchy(member.getEnclosingClass(), (SelectorMapNode<T> node) {
       Link<SelectorValue<T>> selectors = node.selectorsByName[member.name];
-      if (selectors === null) return true;
+      if (selectors == null) return true;
       for (Link link = selectors; !link.isEmpty(); link = link.tail) {
         SelectorValue<T> existing = link.head;
         Selector selector = existing.selector;
diff --git a/lib/compiler/implementation/universe/universe.dart b/lib/compiler/implementation/universe/universe.dart
index 03bb1a6..76a9aa5 100644
--- a/lib/compiler/implementation/universe/universe.dart
+++ b/lib/compiler/implementation/universe/universe.dart
@@ -2,19 +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.
 
-#library('universe');
+library universe;
 
-#import('../closure.dart');
-#import('../elements/elements.dart');
-#import('../leg.dart');
-#import('../scanner/scannerlib.dart');
-#import('../runtime_types.dart');
-#import('../tree/tree.dart');
-#import('../util/util.dart');
+import '../closure.dart';
+import '../elements/elements.dart';
+import '../dart2jslib.dart';
+import '../runtime_types.dart';
+import '../tree/tree.dart';
+import '../util/util.dart';
 
-#source('function_set.dart');
-#source('partial_type_tree.dart');
-#source('selector_map.dart');
+part 'function_set.dart';
+part 'partial_type_tree.dart';
+part 'selector_map.dart';
 
 class Universe {
   /**
@@ -77,7 +76,7 @@
   bool hasMatchingSelector(Set<Selector> selectors,
                            Element member,
                            Compiler compiler) {
-    if (selectors === null) return false;
+    if (selectors == null) return false;
     for (Selector selector in selectors) {
       if (selector.applies(member, compiler)) return true;
     }
@@ -201,19 +200,19 @@
   Selector.noSuchMethod()
       : this(SelectorKind.CALL, Compiler.NO_SUCH_METHOD, null, 2);
 
-  bool isGetter() => kind === SelectorKind.GETTER;
-  bool isSetter() => kind === SelectorKind.SETTER;
-  bool isCall() => kind === SelectorKind.CALL;
+  bool isGetter() => identical(kind, SelectorKind.GETTER);
+  bool isSetter() => identical(kind, SelectorKind.SETTER);
+  bool isCall() => identical(kind, SelectorKind.CALL);
 
-  bool isIndex() => kind === SelectorKind.INDEX && argumentCount == 1;
-  bool isIndexSet() => kind === SelectorKind.INDEX && argumentCount == 2;
+  bool isIndex() => identical(kind, SelectorKind.INDEX) && argumentCount == 1;
+  bool isIndexSet() => identical(kind, SelectorKind.INDEX) && argumentCount == 2;
 
-  bool isOperator() => kind === SelectorKind.OPERATOR;
+  bool isOperator() => identical(kind, SelectorKind.OPERATOR);
   bool isUnaryOperator() => isOperator() && argumentCount == 0;
   bool isBinaryOperator() => isOperator() && argumentCount == 1;
 
   /** Check whether this is a call to 'assert'. */
-  bool isAssert() => isCall() && name.stringValue === "assert";
+  bool isAssert() => isCall() && identical(name.stringValue, "assert");
 
   int hashCode() => argumentCount + 1000 * namedArguments.length;
   int get namedArgumentCount => namedArguments.length;
@@ -429,13 +428,13 @@
 
   bool operator ==(other) {
     if (other is !Selector) return false;
-    return receiverType === other.receiverType
+    return identical(receiverType, other.receiverType)
         && equalsUntyped(other);
   }
 
   bool equalsUntyped(Selector other) {
     return name == other.name
-           && library === other.library
+           && identical(library, other.library)
            && argumentCount == other.argumentCount
            && namedArguments.length == other.namedArguments.length
            && sameNames(namedArguments, other.namedArguments);
@@ -494,11 +493,11 @@
    */
   bool hasElementIn(ClassElement cls, Element element) {
     Element resolved = cls.lookupMember(element.name);
-    if (resolved === element) return true;
-    if (resolved === null) return false;
-    if (resolved.kind === ElementKind.ABSTRACT_FIELD) {
+    if (identical(resolved, element)) return true;
+    if (resolved == null) return false;
+    if (identical(resolved.kind, ElementKind.ABSTRACT_FIELD)) {
       AbstractFieldElement field = resolved;
-      if (element === field.getter || element === field.setter) {
+      if (identical(element, field.getter) || identical(element, field.setter)) {
         return true;
       } else {
         ClassElement otherCls = field.getEnclosingClass();
@@ -519,7 +518,7 @@
     //   bar() => foo(); // The call to 'foo' is a typed selector.
     // }
     ClassElement other = element.getEnclosingClass();
-    if (other.superclass === compiler.closureClass) {
+    if (identical(other.superclass, compiler.closureClass)) {
       return appliesUntyped(element, compiler);
     }
 
diff --git a/lib/compiler/implementation/util/link_implementation.dart b/lib/compiler/implementation/util/link_implementation.dart
index 82a8988..a7da8ec 100644
--- a/lib/compiler/implementation/util/link_implementation.dart
+++ b/lib/compiler/implementation/util/link_implementation.dart
@@ -27,7 +27,7 @@
 
   void printOn(StringBuffer buffer, [separatedBy]) {
     buffer.add(head);
-    if (separatedBy === null) separatedBy = '';
+    if (separatedBy == null) separatedBy = '';
     for (Link link = tail; !link.isEmpty(); link = link.tail) {
       buffer.add(separatedBy);
       buffer.add(link.head);
@@ -97,7 +97,7 @@
   LinkBuilderImplementation();
 
   Link<T> toLink() {
-    if (head === null) return const Link();
+    if (head == null) return const Link();
     lastLink.tail = const Link();
     Link<T> link = head;
     lastLink = null;
@@ -108,7 +108,7 @@
   void addLast(T t) {
     length++;
     LinkEntry<T> entry = new LinkEntry<T>(t, null);
-    if (head === null) {
+    if (head == null) {
       head = entry;
     } else {
       lastLink.tail = entry;
diff --git a/lib/compiler/implementation/warnings.dart b/lib/compiler/implementation/warnings.dart
index 9d00fd4..5814036 100644
--- a/lib/compiler/implementation/warnings.dart
+++ b/lib/compiler/implementation/warnings.dart
@@ -175,6 +175,9 @@
   static const CANNOT_INSTANTIATE_TYPEDEF = const MessageKind(
       "cannot instantiate typedef '#{1}'");
 
+  static const CANNOT_INSTANTIATE_TYPE_VARIABLE = const MessageKind(
+      "cannot instantiate type variable '#{1}'");
+
   static const NO_DEFAULT_CLASS = const MessageKind(
       "no default class on enclosing interface '#{1}'");
 
@@ -299,7 +302,7 @@
   static const PATCH_PARAMETER_MISMATCH = const MessageKind(
       "Patch method parameter '#{3}' doesn't match '#{2}' on origin method "
       "#{1}.");
-  
+
   static const TOP_LEVEL_VARIABLE_DECLARED_STATIC = const MessageKind(
       "Top-level variable cannot be declared static.");
 
@@ -352,7 +355,7 @@
   Message(this.kind, this.arguments);
 
   String toString() {
-    if (message === null) {
+    if (message == null) {
       message = kind.template;
       int position = 1;
       for (var argument in arguments) {
diff --git a/lib/compiler/implementation/world.dart b/lib/compiler/implementation/world.dart
index 7a49dd6..ee91eef 100644
--- a/lib/compiler/implementation/world.dart
+++ b/lib/compiler/implementation/world.dart
@@ -122,22 +122,22 @@
    * types.
    */
   MemberSet _memberSetFor(DartType type, Selector selector) {
-    assert(compiler !== null);
+    assert(compiler != null);
     ClassElement cls = type.element;
     SourceString name = selector.name;
     LibraryElement library = selector.library;
     MemberSet result = new MemberSet(name);
     Element element = cls.implementation.lookupSelector(selector);
-    if (element !== null) result.add(element);
+    if (element != null) result.add(element);
 
     bool isPrivate = name.isPrivate();
     Set<ClassElement> subtypesOfCls = subtypes[cls];
-    if (subtypesOfCls !== null) {
+    if (subtypesOfCls != null) {
       for (ClassElement sub in subtypesOfCls) {
         // Private members from a different library are not visible.
         if (isPrivate && sub.getLibrary() != library) continue;
         element = sub.implementation.lookupLocalMember(name);
-        if (element !== null) result.add(element);
+        if (element != null) result.add(element);
       }
     }
     return result;
@@ -167,7 +167,7 @@
     MemberSet memberSet = _memberSetFor(type, noSuchMethodSelector);
     for (Element element in memberSet.elements) {
       ClassElement holder = element.getEnclosingClass();
-      if (holder !== compiler.objectClass &&
+      if (!identical(holder, compiler.objectClass) &&
           noSuchMethodSelector.applies(element, compiler)) {
         result.add(holder);
       }
diff --git a/lib/compiler/samples/leap/leap.dart b/lib/compiler/samples/leap/leap.dart
index ce7b9c2..3dba298 100644
--- a/lib/compiler/samples/leap/leap.dart
+++ b/lib/compiler/samples/leap/leap.dart
@@ -2,18 +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.
 
-#library('leap');
+library leap;
 
-#import('dart:isolate');
-#import('dart:uri');
+import 'dart:isolate';
+import 'dart:uri';
 
-#import('dart:html', prefix: 'html');
-#import('request_cache.dart');
-#import('../../lib/compiler/implementation/elements/elements.dart');
-#import('../../lib/compiler/implementation/leg.dart');
-#import('../../lib/compiler/implementation/tree/tree.dart');
-#import('../../lib/compiler/implementation/source_file.dart');
-#import('../../lib/compiler/implementation/library_map.dart');
+import 'dart:html' as html;
+import 'request_cache.dart';
+import '../../lib/compiler/implementation/elements/elements.dart';
+import '../../lib/compiler/implementation/dart2jslib.dart';
+import '../../lib/compiler/implementation/tree/tree.dart';
+import '../../lib/compiler/implementation/source_file.dart';
+import '../../lib/compiler/implementation/library_map.dart';
 
-#source('leap_leg.dart');
-#source('leap_script.dart');
+part 'leap_leg.dart';
+part 'leap_script.dart';
diff --git a/lib/compiler/samples/leap/leap_leg.dart b/lib/compiler/samples/leap/leap_leg.dart
index fd70073..5890ab9 100644
--- a/lib/compiler/samples/leap/leap_leg.dart
+++ b/lib/compiler/samples/leap/leap_leg.dart
@@ -25,7 +25,7 @@
   // Should be called when [codeDiv] has changed. For now, call it always
   // on mouse up and key up events.
   update() {
-    if (port === null) return;
+    if (port == null) return;
     port.call(codeDiv.text).then(setOutline);
   }
 
@@ -230,10 +230,10 @@
   }
 
   currentScript() {
-    if (currentElement === null) return null;
+    if (currentElement == null) return null;
     CompilationUnitElement compilationUnit =
       currentElement.getCompilationUnit();
-    if (compilationUnit === null) return null;
+    if (compilationUnit == null) return null;
     return compilationUnit.script;
   }
 
@@ -256,7 +256,7 @@
     cancel(message.toString(), node);
   }
 
-  void cancel([String reason, Node node, token, instruction, element]) {
+  void cancel(String reason, {Node node, token, instruction, element}) {
     print(reason);
   }
 
diff --git a/lib/core/collection.dart b/lib/core/collection.dart
index ffad48d..22381ab 100644
--- a/lib/core/collection.dart
+++ b/lib/core/collection.dart
@@ -3,26 +3,57 @@
 // BSD-style license that can be found in the LICENSE file.
 
 /**
- * The [Collection] interface is the public interface of all
- * collections.
+ * The common interface of all collections.
+ *
+ * The [Collection] class contains a skeleton implementation of
+ * an iterator based collection.
  */
 abstract class Collection<E> extends Iterable<E> {
   /**
-   * Applies the function [f] to each element of this collection.
-   */
-  void forEach(void f(E element));
-
-  /**
    * Returns a new collection with the elements [: f(e) :]
    * for each element [:e:] of this collection.
    *
-   * Note on typing: the return type of f() could be an arbitrary
-   * type and consequently the returned collection's
-   * typeis Collection.
+   * Subclasses of [Collection] should implement the [map] method
+   * to return a collection of the same general type as themselves.
+   * E.g., [List.map] should return a [List].
    */
   Collection map(f(E element));
 
   /**
+   * Returns a collection with the elements of this collection
+   * that satisfy the predicate [f].
+   *
+   * The returned collection should be of the same type as the collection
+   * creating it.
+   *
+   * An element satisfies the predicate [f] if [:f(element):]
+   * returns true.
+   */
+  Collection<E> filter(bool f(E element));
+
+  /**
+   * Returns the number of elements in this collection.
+   */
+  int get length;
+
+  /**
+   * Check whether the collection contains an element equal to [element].
+   */
+  bool contains(E element) {
+    for (E e in this) {
+      if (e == element) return true;
+    }
+    return false;
+  }
+
+  /**
+   * Applies the function [f] to each element of this collection.
+   */
+  void forEach(void f(E element)) {
+    for (E element in this) f(element);
+  }
+
+  /**
    * Reduce a collection to a single value by iteratively combining each element
    * of the collection with an existing value using the provided function.
    * Use [initialValue] as the initial value, and the function [combine] to
@@ -32,37 +63,37 @@
    *
    *   collection.reduce(0, (prev, element) => prev + element);
    */
-  Dynamic reduce(Dynamic initialValue,
-                 Dynamic combine(Dynamic previousValue, E element));
-
-  /**
-   * Returns a new collection with the elements of this collection
-   * that satisfy the predicate [f].
-   *
-   * An element satisfies the predicate [f] if [:f(element):]
-   * returns true.
-   */
-  Collection<E> filter(bool f(E element));
+  Dynamic reduce(var initialValue,
+                 Dynamic combine(var previousValue, E element)) {
+    var value = initialValue;
+    for (E element in this) value = combine(value, element);
+    return value;
+  }
 
   /**
    * Returns true if every elements of this collection satisify the
    * predicate [f]. Returns false otherwise.
    */
-  bool every(bool f(E element));
+  bool every(bool f(E element)) {
+    for (E element in this) {
+      if (!f(element)) return false;
+    }
+    return true;
+  }
 
   /**
    * Returns true if one element of this collection satisfies the
    * predicate [f]. Returns false otherwise.
    */
-  bool some(bool f(E element));
+  bool some(bool f(E element)) {
+    for (E element in this) {
+      if (f(element)) return true;
+    }
+    return false;
+  }
 
   /**
    * Returns true if there is no element in this collection.
    */
-  bool isEmpty();
-
-  /**
-   * Returns the number of elements in this collection.
-   */
-  int get length;
+  bool isEmpty() => !iterator().hasNext();
 }
diff --git a/lib/core/core.dart b/lib/core/core.dart
index 0e76548..5ba5969 100644
--- a/lib/core/core.dart
+++ b/lib/core/core.dart
@@ -32,6 +32,7 @@
 #source("print.dart");
 #source("queue.dart");
 #source("regexp.dart");
+#source("sequences.dart");
 #source("set.dart");
 #source("stopwatch.dart");
 #source("string.dart");
diff --git a/lib/core/corelib_sources.gypi b/lib/core/corelib_sources.gypi
index b95b1f2..a94025b 100644
--- a/lib/core/corelib_sources.gypi
+++ b/lib/core/corelib_sources.gypi
@@ -30,6 +30,7 @@
     'print.dart',
     'queue.dart',
     'regexp.dart',
+    'sequences.dart',
     'set.dart',
     'stopwatch.dart',
     'string.dart',
diff --git a/lib/core/date.dart b/lib/core/date.dart
index d3bafe2..1c496ae 100644
--- a/lib/core/date.dart
+++ b/lib/core/date.dart
@@ -40,10 +40,10 @@
 
   /**
    * Constructs a [Date] instance based on the individual parts. The date is
-   * in the local time zone if [isUtc] is false.
+   * in the local time zone.
    *
    * [month] and [day] are one-based. For example
-   * [:new Date(1938, 1, 10)] represents the 10th of January 1938.
+   * [:new Date(1938, 1, 10):] represents the 10th of January 1938.
    */
   factory Date(int year,
                [int month = 1,
@@ -51,11 +51,30 @@
                 int hour = 0,
                 int minute = 0,
                 int second = 0,
-                int millisecond = 0,
-                bool isUtc = false]) {
+                int millisecond = 0]) {
     return new DateImplementation(year, month, day,
                                   hour, minute, second,
-                                  millisecond, isUtc);
+                                  millisecond, false);
+  }
+
+  /**
+   * Constructs a [Date] instance based on the individual parts. The date is
+   * in the UTC time zone.
+   *
+   * [month] and [day] are one-based. For example
+   * [:new Date.utc(1938, 1, 10):] represents the 10th of January 1938 in
+   * Coordinated Universal Time.
+   */
+  factory Date.utc(int year,
+                   [int month = 1,
+                    int day = 1,
+                    int hour = 0,
+                    int minute = 0,
+                    int second = 0,
+                    int millisecond = 0]) {
+    return new DateImplementation(year, month, day,
+                                  hour, minute, second,
+                                  millisecond, true);
   }
 
   /**
@@ -82,7 +101,7 @@
   // tools don't yet. Eventually we want to have default values here.
   // TODO(lrn): Have two constructors instead of taking an optional bool.
   factory Date.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch,
-                                          [bool isUtc = false]) {
+                                          {bool isUtc: false}) {
     return new DateImplementation.fromMillisecondsSinceEpoch(
         millisecondsSinceEpoch, isUtc);
   }
@@ -120,14 +139,16 @@
   /**
    * Returns [this] in the local time zone. Returns itself if it is already in
    * the local time zone. Otherwise, this method is equivalent to
-   * [:new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, false):].
+   * [:new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+   *                                       isUtc: false):].
    */
   Date toLocal();
 
   /**
    * Returns [this] in UTC. Returns itself if it is already in UTC. Otherwise,
    * this method is equivalent to
-   * [:new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, true):].
+   * [:new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+   *                                       isUtc: true):].
    */
   Date toUtc();
 
diff --git a/lib/core/errors.dart b/lib/core/errors.dart
index cef165e..97465fc 100644
--- a/lib/core/errors.dart
+++ b/lib/core/errors.dart
@@ -129,3 +129,9 @@
 
   external static String _objectToString(Object object);
 }
+
+
+class OutOfMemoryError implements Exception {
+  const OutOfMemoryError();
+  String toString() => "Out of Memory";
+}
diff --git a/lib/core/exceptions.dart b/lib/core/exceptions.dart
index e6ee7ac..c57603a 100644
--- a/lib/core/exceptions.dart
+++ b/lib/core/exceptions.dart
@@ -8,11 +8,21 @@
  * Interface implemented by all core library exceptions.
  * Defaults to an implementation that only carries a simple message.
  */
-interface Exception default ExceptionImplementation {
+interface Exception default _ExceptionImplementation {
+  // TODO(lrn): This should be an abstract class, but we don't yet support
+  // redirecting factory constructors.
   const Exception([var message]);
 }
 
 
+/** Default implementation of [Exception] which carries a message. */
+class _ExceptionImplementation implements Exception {
+  final message;
+  const _ExceptionImplementation([this.message]);
+  String toString() => (message == null) ? "Exception" : "Exception: $message";
+}
+
+
 /**
  * Exception thrown because of an index outside of the valid range.
  */
@@ -24,7 +34,6 @@
   final _value;
 }
 
-
 /**
  * Exception thrown because of attempt to modify an immutable object.
  */
@@ -46,12 +55,6 @@
 }
 
 
-class OutOfMemoryException implements Exception {
-  const OutOfMemoryException();
-  String toString() => "Out of Memory";
-}
-
-
 class StackOverflowException implements Exception {
   const StackOverflowException();
   String toString() => "Stack Overflow";
diff --git a/lib/core/list.dart b/lib/core/list.dart
index e44e743..04ad11f 100644
--- a/lib/core/list.dart
+++ b/lib/core/list.dart
@@ -6,8 +6,8 @@
  * A [List] is an indexable collection with a length. It can be of
  * fixed size or extendable.
  */
-interface List<E> extends Collection<E> default ListImplementation<E> {
-
+interface List<E> extends Collection<E>, Sequence<E>
+                  default ListImplementation<E> {
   /**
    * Creates a list of the given [length].
    *
@@ -69,7 +69,7 @@
   /**
    * Sorts the list according to the order specified by the [Comparator].
    */
-  void sort(Comparator<E> compare);
+  void sort([Comparator<E> compare = Comparable.compare]);
 
   /**
    * Returns the first index of [element] in the list.
diff --git a/lib/core/sequences.dart b/lib/core/sequences.dart
new file mode 100644
index 0000000..5ed4366
--- /dev/null
+++ b/lib/core/sequences.dart
@@ -0,0 +1,204 @@
+// Copyright (c) 2012, 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.
+
+/**
+ * An indexed sequence of elements of the same type.
+ *
+ * This is a primitive interface that any finite integer-indexable
+ * sequence can implement.
+ * It is intended for data structures where access by index is
+ * the most efficient way to access the data.
+ */
+abstract class Sequence<T> {
+  /**
+   * The limit of valid indices of the sequence.
+   *
+   * The length getter should be efficient.
+   */
+  int get length;
+
+  /**
+   * Returns the value at the given [index].
+   *
+   * Valid indices must be in the range [:0..length - 1:].
+   * The lookup operator should be efficient.
+   */
+  T operator[](int index);
+}
+
+/**
+ * A skeleton class for a [Collection] that is also a [Sequence].
+ */
+abstract class SequenceCollection<E> implements Collection<E>, Sequence<E> {
+  // The class is intended for use as a mixin as well.
+
+  Iterator<E> iterator() => new SequenceIterator(sequence);
+
+  void forEach(f(E element)) {
+    for (int i = 0; i < this.length; i++) f(this[i]);
+  }
+
+  Collection map(f(E element)) {
+    List result = new List();
+    for (int i = 0; i < this.length; i++) {
+      result.add(f(this[i]));
+    }
+    return result;
+  }
+
+  bool contains(E value) {
+    for (int i = 0; i < sequence.length; i++) {
+      if (sequence[i] == value) return true;
+    }
+    return false;
+  }
+
+  reduce(initialValue, combine(previousValue, E element)) {
+    var value = initialValue;
+    for (int i = 0; i < this.length; i++) {
+      value = combine(value, this[i]);
+    }
+    return value;
+  }
+
+  Collection<E> filter(bool f(E element)) {
+    List<E> result = <E>[];
+    for (int i = 0; i < this.length; i++) {
+      E element = this[i];
+      if (f(element)) result.add(element);
+    }
+    return result;
+  }
+
+  bool every(bool f(E element)) {
+    for (int i = 0; i < this.length; i++) {
+      if (!f(this[i])) return false;
+    }
+    return true;
+  }
+
+  bool some(bool f(E element)) {
+    for (int i = 0; i < this.length; i++) {
+      if (f(this[i])) return true;
+    }
+    return false;
+  }
+
+  bool isEmpty() {
+    return this.length == 0;
+  }
+}
+
+
+/**
+ * An unmodifiable [List] backed by a [Sequence].
+ */
+class SequenceList<E> extends SequenceCollection<E> implements List<E> {
+  Sequence<E> sequence;
+  SequenceList(this.sequence);
+
+  int get length => sequence.length;
+
+  T operator[](int index) => sequence[index];
+
+  int indexOf(E value, [int start = 0]) {
+    for (int i = start; i < sequence.length; i++) {
+      if (sequence[i] == value) return i;
+    }
+    return -1;
+  }
+
+  int lastIndexOf(E value, [int start]) {
+    if (start == null) start = sequence.length - 1;
+    for (int i = start; i >= 0; i--) {
+      if (sequence[i] == value) return i;
+    }
+    return -1;
+  }
+
+  E last() => sequence[sequence.length - 1];
+
+  List<E> getRange(int start, int length) {
+    List<E> result = <E>[];
+    for (int i = 0; i < length; i++) {
+      result.add(sequence[start + i]);
+    }
+    return result;
+  }
+
+  void operator []=(int index, E value) {
+    throw new UnsupportedOperationException(
+        "Cannot modify an unmodifiable list");
+  }
+
+  void set length(int newLength) {
+    throw new UnsupportedOperationException(
+        "Cannot change the length of an unmodifiable list");
+  }
+
+  void add(E value) {
+    throw new UnsupportedOperationException(
+        "Cannot add to an unmodifiable list");
+  }
+
+  void addLast(E value) {
+    throw new UnsupportedOperationException(
+        "Cannot add to an unmodifiable list");
+  }
+
+  void addAll(Collection<E> collection) {
+    throw new UnsupportedOperationException(
+        "Cannot add to an unmodifiable list");
+  }
+
+  void sort([Comparator<E> compare]) {
+    throw new UnsupportedOperationException(
+        "Cannot modify an unmodifiable list");
+  }
+
+  void clear() {
+    throw new UnsupportedOperationException(
+        "Cannot clear an unmodifiable list");
+  }
+
+  E removeAt(int index) {
+    throw new UnsupportedOperationException(
+        "Cannot remove in an unmodifiable list");
+  }
+
+  E removeLast() {
+    throw new UnsupportedOperationException(
+        "Cannot remove in an unmodifiable list");
+  }
+
+  void setRange(int start, int length, List<E> from, [int startFrom]) {
+    throw new UnsupportedOperationException(
+        "Cannot modify an unmodifiable list");
+  }
+
+  void removeRange(int start, int length) {
+    throw new UnsupportedOperationException(
+        "Cannot remove in an unmodifiable list");
+  }
+
+  void insertRange(int start, int length, [E initialValue]) {
+    throw new UnsupportedOperationException(
+        "Cannot insert range in an unmodifiable list");
+  }
+}
+
+/**
+ * Iterates over a [Sequence] in growing index order.
+ */
+class SequenceIterator<E> implements Iterator<E> {
+  Sequence<E> _sequence;
+  int _position;
+  SequenceIterator(this._sequence) : _position = 0;
+  bool hasNext() => _position < _sequence.length;
+  E next() {
+    if (hasNext()) return _sequence[_position++];
+    throw new NoMoreElementsException();
+  }
+}
+
diff --git a/lib/core/string.dart b/lib/core/string.dart
index b841cf3..7d23302 100644
--- a/lib/core/string.dart
+++ b/lib/core/string.dart
@@ -9,7 +9,7 @@
  * [charCodes] method.
  */
 interface String
-    extends Comparable, Pattern
+    extends Comparable, Pattern, Sequence<String>
     default StringImplementation {
   /**
    * Allocates a new String for the specified [charCodes].
diff --git a/lib/coreimpl/collections.dart b/lib/coreimpl/collections.dart
index 07f0aba..55e76fa 100644
--- a/lib/coreimpl/collections.dart
+++ b/lib/coreimpl/collections.dart
@@ -8,6 +8,13 @@
  * method.
  */
 class Collections {
+  static bool contains(Iterable iterable, var element) {
+    for (final e in iterable) {
+      if (element == e) return true;
+    }
+    return false;
+  }
+
   static void forEach(Iterable iterable, void f(o)) {
     for (final e in iterable) {
       f(e);
diff --git a/lib/coreimpl/coreimpl.dart b/lib/coreimpl/coreimpl.dart
index 7fced71..d3817e7 100644
--- a/lib/coreimpl/coreimpl.dart
+++ b/lib/coreimpl/coreimpl.dart
@@ -8,7 +8,6 @@
 #source("collections.dart");
 #source("date.dart");
 #source("dual_pivot_quicksort.dart");
-#source("exceptions.dart");
 #source("future_implementation.dart");
 #source("hash_map_set.dart");
 #source("linked_hash_map.dart");
diff --git a/lib/coreimpl/corelib_impl_sources.gypi b/lib/coreimpl/corelib_impl_sources.gypi
index 99b9c6d..3128f67 100644
--- a/lib/coreimpl/corelib_impl_sources.gypi
+++ b/lib/coreimpl/corelib_impl_sources.gypi
@@ -8,7 +8,6 @@
     'collections.dart',
     'date.dart',
     'dual_pivot_quicksort.dart',
-    'exceptions.dart',
     'future_implementation.dart',
     'hash_map_set.dart',
     'linked_hash_map.dart',
diff --git a/lib/coreimpl/date.dart b/lib/coreimpl/date.dart
index 2138ba5..6aba63f 100644
--- a/lib/coreimpl/date.dart
+++ b/lib/coreimpl/date.dart
@@ -53,7 +53,8 @@
         throw new ArgumentError(formattedString);
       }
       if (addOneMillisecond) millisecondsSinceEpoch++;
-      return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, isUtc);
+      return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+                                                 isUtc: isUtc);
     } else {
       throw new ArgumentError(formattedString);
     }
@@ -93,14 +94,16 @@
 
   Date toLocal() {
     if (isUtc) {
-      return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, false);
+      return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+                                                 isUtc: false);
     }
     return this;
   }
 
   Date toUtc() {
     if (isUtc) return this;
-    return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, true);
+    return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
+                                               isUtc: true);
   }
 
   String toString() {
@@ -142,14 +145,14 @@
   Date add(Duration duration) {
     int ms = millisecondsSinceEpoch;
     return new Date.fromMillisecondsSinceEpoch(
-        ms + duration.inMilliseconds, isUtc);
+        ms + duration.inMilliseconds, isUtc: isUtc);
   }
 
   /** Returns a new [Date] with the [duration] subtracted from [this]. */
   Date subtract(Duration duration) {
     int ms = millisecondsSinceEpoch;
     return new Date.fromMillisecondsSinceEpoch(
-        ms - duration.inMilliseconds, isUtc);
+        ms - duration.inMilliseconds, isUtc: isUtc);
   }
 
   /** Returns a [Duration] with the difference of [this] and [other]. */
@@ -159,15 +162,14 @@
     return new Duration(milliseconds: ms - otherMs);
   }
 
-  // TODO(lrn): Make parameters not optional for the implementation class.
   external DateImplementation(int year,
-                              [int month = 1,
-                               int day = 1,
-                               int hour = 0,
-                               int minute = 0,
-                               int second = 0,
-                               int millisecond = 0,
-                               bool isUtc = false]);
+                              int month,
+                              int day,
+                              int hour,
+                              int minute,
+                              int second,
+                              int millisecond,
+                              bool isUtc);
   external DateImplementation.now();
   external static int _brokenDownDateToMillisecondsSinceEpoch(
       int year, int month, int day, int hour, int minute, int second,
diff --git a/lib/coreimpl/exceptions.dart b/lib/coreimpl/exceptions.dart
deleted file mode 100644
index 72559ba..0000000
--- a/lib/coreimpl/exceptions.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// 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.
-
-class ExceptionImplementation implements Exception {
-  final message;
-  const ExceptionImplementation([this.message]);
-  String toString() => (message == null) ? "Exception" : "Exception: $message";
-}
diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart
index 1901457..537402a 100644
--- a/lib/html/dart2js/html_dart2js.dart
+++ b/lib/html/dart2js/html_dart2js.dart
@@ -15,12 +15,12 @@
 
 
 
-LocalWindow get window() native "return window;";
-_LocalWindowImpl get _window() native "return window;";
+LocalWindow get window() => JS('LocalWindow', 'window');
+_LocalWindowImpl get _window() => JS('_LocalWindowImpl', 'window');
 
-Document get document() native "return document;";
+Document get document() => JS('Document', 'document');
 
-_DocumentImpl get _document() native "return document;";
+_DocumentImpl get _document() => JS('_DocumentImpl', 'document');
 
 Element query(String selector) => _document.query(selector);
 List<Element> queryAll(String selector) => _document.queryAll(selector);
@@ -31,12 +31,12 @@
 }
 
 // Support for Send/ReceivePortSync.
-int _getNewIsolateId() native r'''
-  if (!window.$dart$isolate$counter) {
-    window.$dart$isolate$counter = 1;
+int _getNewIsolateId() {
+  if (JS('bool', r'!window.$dart$isolate$counter')) {
+    JS('void', r'window.$dart$isolate$counter = 1');
   }
-  return window.$dart$isolate$counter++;
-''';
+  return JS('int', r'window.$dart$isolate$counter++');
+}
 
 // Fast path to invoke JS send port.
 _callPortSync(int id, message) {
@@ -100,7 +100,7 @@
 /// @domName HTMLAnchorElement
 abstract class AnchorElement implements Element {
 
-  factory AnchorElement([String href]) {
+  factory AnchorElement({String href}) {
     if (!?href) {
       return _Elements.createAnchorElement();
     }
@@ -588,7 +588,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool AudioBufferCallback(AudioBuffer audioBuffer);
+typedef void AudioBufferCallback(AudioBuffer audioBuffer);
 
 class _AudioBufferImpl implements AudioBuffer native "*AudioBuffer" {
 
@@ -2211,7 +2211,7 @@
 
   final int length;
 
-  _CSSRuleImpl operator[](int index) native "return this[index];";
+  _CSSRuleImpl operator[](int index) => JS("_CSSRuleImpl", "#[#]", this, index);
 
   void operator[]=(int index, _CSSRuleImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -2242,6 +2242,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(CSSRule element) => _Collections.contains(this, element);
+
   void forEach(void f(CSSRule element)) => _Collections.forEach(this, f);
 
   Collection map(f(CSSRule element)) => _Collections.map(this, [], f);
@@ -2257,7 +2259,7 @@
 
   // From List<CSSRule>:
 
-  void sort(int compare(CSSRule a, CSSRule b)) {
+  void sort([Comparator<CSSRule> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -4232,13 +4234,13 @@
     return propValue != null ? propValue : '';
   }
 
-  void setProperty(String propertyName, String value, [String priority]) native '''
-    this.setProperty(propertyName, value, priority);
+  void setProperty(String propertyName, String value, [String priority]) {
+    JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
     // Bug #2772, IE9 requires a poke to actually apply the value.
-    if (this.setAttribute) {
-      this.setAttribute(propertyName, value);
+    if (JS('bool', '!!#.setAttribute', this)) {
+      JS('void', '#.setAttribute(#, #)', this, propertyName, value);
     }
-  ''';
+  }
 
   // TODO(jacobr): generate this list of properties using the existing script.
     /** Gets the value of "animation" */
@@ -7179,7 +7181,7 @@
 
   final int length;
 
-  _CSSValueImpl operator[](int index) native "return this[index];";
+  _CSSValueImpl operator[](int index) => JS("_CSSValueImpl", "#[#]", this, index);
 
   void operator[]=(int index, _CSSValueImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -7210,6 +7212,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(CSSValue element) => _Collections.contains(this, element);
+
   void forEach(void f(CSSValue element)) => _Collections.forEach(this, f);
 
   Collection map(f(CSSValue element)) => _Collections.map(this, [], f);
@@ -7225,7 +7229,7 @@
 
   // From List<CSSValue>:
 
-  void sort(int compare(CSSValue a, CSSValue b)) {
+  void sort([Comparator<CSSValue> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -7271,7 +7275,7 @@
 /// @domName HTMLCanvasElement
 abstract class CanvasElement implements Element {
 
-  factory CanvasElement([int width, int height]) {
+  factory CanvasElement({int width, int height}) {
     if (!?width) {
       return _Elements.createCanvasElement();
     }
@@ -7907,7 +7911,7 @@
 
   final int length;
 
-  _ClientRectImpl operator[](int index) native "return this[index];";
+  _ClientRectImpl operator[](int index) => JS("_ClientRectImpl", "#[#]", this, index);
 
   void operator[]=(int index, _ClientRectImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -7938,6 +7942,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(ClientRect element) => _Collections.contains(this, element);
+
   void forEach(void f(ClientRect element)) => _Collections.forEach(this, f);
 
   Collection map(f(ClientRect element)) => _Collections.map(this, [], f);
@@ -7953,7 +7959,7 @@
 
   // From List<ClientRect>:
 
-  void sort(int compare(ClientRect a, ClientRect b)) {
+  void sort([Comparator<ClientRect> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -8186,7 +8192,7 @@
 
 class _ConsoleImpl
     // Console is sometimes a singleton bag-of-properties without a prototype.
-    implements Console 
+    implements Console
     native "=(typeof console == 'undefined' ? {} : console)" {
 
   final _MemoryInfoImpl memory;
@@ -8740,7 +8746,7 @@
 
   final int length;
 
-  _DOMMimeTypeImpl operator[](int index) native "return this[index];";
+  _DOMMimeTypeImpl operator[](int index) => JS("_DOMMimeTypeImpl", "#[#]", this, index);
 
   void operator[]=(int index, _DOMMimeTypeImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -8771,6 +8777,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(DOMMimeType element) => _Collections.contains(this, element);
+
   void forEach(void f(DOMMimeType element)) => _Collections.forEach(this, f);
 
   Collection map(f(DOMMimeType element)) => _Collections.map(this, [], f);
@@ -8786,7 +8794,7 @@
 
   // From List<DOMMimeType>:
 
-  void sort(int compare(DOMMimeType a, DOMMimeType b)) {
+  void sort([Comparator<DOMMimeType> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -8908,7 +8916,7 @@
 
   final int length;
 
-  _DOMPluginImpl operator[](int index) native "return this[index];";
+  _DOMPluginImpl operator[](int index) => JS("_DOMPluginImpl", "#[#]", this, index);
 
   void operator[]=(int index, _DOMPluginImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -8939,6 +8947,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(DOMPlugin element) => _Collections.contains(this, element);
+
   void forEach(void f(DOMPlugin element)) => _Collections.forEach(this, f);
 
   Collection map(f(DOMPlugin element)) => _Collections.map(this, [], f);
@@ -8954,7 +8964,7 @@
 
   // From List<DOMPlugin>:
 
-  void sort(int compare(DOMPlugin a, DOMPlugin b)) {
+  void sort([Comparator<DOMPlugin> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -9169,30 +9179,12 @@
 
   String value;
 }
-// Copyright (c) 2012, 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.
 
-// WARNING: Do not edit - generated code.
-
-/// @domName DOMStringList
-abstract class DOMStringList implements List<String> {
-
-  /** @domName DOMStringList.length */
-  abstract int get length;
-
-  /** @domName DOMStringList.contains */
-  bool contains(String string);
-
-  /** @domName DOMStringList.item */
-  String item(int index);
-}
-
-class _DOMStringListImpl implements DOMStringList, JavaScriptIndexingBehavior native "*DOMStringList" {
+class _DOMStringListImpl implements List<String>, JavaScriptIndexingBehavior native "*DOMStringList" {
 
   final int length;
 
-  String operator[](int index) native "return this[index];";
+  String operator[](int index) => JS("String", "#[#]", this, index);
 
   void operator[]=(int index, String value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -9223,6 +9215,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  // contains() defined by IDL.
+
   void forEach(void f(String element)) => _Collections.forEach(this, f);
 
   Collection map(f(String element)) => _Collections.map(this, [], f);
@@ -9238,7 +9232,7 @@
 
   // From List<String>:
 
-  void sort(int compare(String a, String b)) {
+  void sort([Comparator<String> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -9564,7 +9558,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool DatabaseCallback(database);
+typedef void DatabaseCallback(database);
 
 class _DatabaseImpl implements Database native "*Database" {
 
@@ -9641,7 +9635,7 @@
   _DedicatedWorkerContextEventsImpl get on =>
     new _DedicatedWorkerContextEventsImpl(this);
 
-  void postMessage(message, [messagePorts]) {
+  void postMessage(/*any*/ message, [messagePorts]) {
     if (?messagePorts) {
       var message_1 = _convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, messagePorts);
@@ -10286,7 +10280,11 @@
     add(value);
   }
 
-  void sort(int compare(Element a, Element b)) {
+  bool contains(Element element) {
+    return element is Element && _childNodes.contains(element);
+  }
+
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('TODO(jacobr): should we impl?');
   }
 
@@ -10623,7 +10621,7 @@
   String cookie;
 
   Window get window => _convertNativeToDart_Window(this._window);
-  Window get _window() native "return this.defaultView;";
+  Window get _window() => JS("Window", "#.defaultView", this);
 
   final _ElementImpl documentElement;
 
@@ -10721,7 +10719,7 @@
 
   void webkitExitPointerLock() native;
 
-  // TODO(jacobr): implement all Element methods not on Document. 
+  // TODO(jacobr): implement all Element methods not on Document.
 
   _ElementImpl query(String selectors) {
     // It is fine for our RegExp to detect element id query selectors to have
@@ -11390,6 +11388,8 @@
     return output;
   }
 
+  bool contains(Element element) => _childElements.contains(element);
+
   void forEach(void f(Element element)) {
     for (_ElementImpl element in _childElements) {
       f(element);
@@ -11407,7 +11407,7 @@
   }
 
   bool every(bool f(Element element)) {
-    for(Element element in this) {
+    for (Element element in this) {
       if (!f(element)) {
         return false;
       }
@@ -11416,7 +11416,7 @@
   }
 
   bool some(bool f(Element element)) {
-    for(Element element in this) {
+    for (Element element in this) {
       if (f(element)) {
         return true;
       }
@@ -11468,7 +11468,7 @@
     }
   }
 
-  void sort(int compare(Element a, Element b)) {
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('TODO(jacobr): should we impl?');
   }
 
@@ -11528,6 +11528,13 @@
     return _nodeList[0];
   }
 
+  bool contains(Element element) {
+    for (Element el in this) {
+      if (el == element) return true;
+    }
+    return false;
+  }
+
   void forEach(void f(Element element)) {
     for (Element el in this) {
       f(el);
@@ -11596,7 +11603,7 @@
     throw const UnsupportedOperationException('');
   }
 
-  void sort(int compare(Element a, Element b)) {
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('');
   }
 
@@ -12101,7 +12108,7 @@
 
   /** @domName Element.insertAdjacentText */
   void insertAdjacentText(String where, String text) {
-    if (JS('bool', '!!this.insertAdjacentText')) {
+    if (JS('bool', '!!#.insertAdjacentText', this)) {
       _insertAdjacentText(where, text);
     } else {
       _insertAdjacentNode(where, new Text(text));
@@ -12113,7 +12120,7 @@
 
   /** @domName Element.insertAdjacentHTML */
   void insertAdjacentHTML(String where, String text) {
-    if (JS('bool', '!!this.insertAdjacentHTML')) {
+    if (JS('bool', '!!#.insertAdjacentHTML', this)) {
       _insertAdjacentHTML(where, text);
     } else {
       _insertAdjacentNode(where, new DocumentFragment.html(text));
@@ -12125,7 +12132,7 @@
 
   /** @domName Element.insertAdjacentHTML */
   Element insertAdjacentElement(String where, Element element) {
-    if (JS('bool', '!!this.insertAdjacentElement')) {
+    if (JS('bool', '!!#.insertAdjacentElement', this)) {
       _insertAdjacentElement(where, element);
     } else {
       _insertAdjacentNode(where, element);
@@ -12160,7 +12167,7 @@
   _ElementEventsImpl get on =>
     new _ElementEventsImpl(this);
 
-  _HTMLCollectionImpl get $dom_children() native "return this.children;";
+  _HTMLCollectionImpl get $dom_children() => JS("_HTMLCollectionImpl", "#.children", this);
 
   String contentEditable;
 
@@ -12192,11 +12199,13 @@
 
   void click() native;
 
-  int get $dom_childElementCount() native "return this.childElementCount;";
+  int get $dom_childElementCount() => JS("int", "#.childElementCount", this);
 
-  String get $dom_className() native "return this.className;";
+  String get $dom_className() => JS("String", "#.className", this);
 
-  void set $dom_className(String value) native "this.className = value;";
+  void set $dom_className(String value) {
+    JS("void", "#.className = #", this, value);
+  }
 
   final int clientHeight;
 
@@ -12208,9 +12217,9 @@
 
   final Map<String, String> dataset;
 
-  _ElementImpl get $dom_firstElementChild() native "return this.firstElementChild;";
+  _ElementImpl get $dom_firstElementChild() => JS("_ElementImpl", "#.firstElementChild", this);
 
-  _ElementImpl get $dom_lastElementChild() native "return this.lastElementChild;";
+  _ElementImpl get $dom_lastElementChild() => JS("_ElementImpl", "#.lastElementChild", this);
 
   final _ElementImpl nextElementSibling;
 
@@ -12336,8 +12345,8 @@
   /** @domName Document.createElement */
   // Optimization to improve performance until the dart2js compiler inlines this
   // method.
-  static Element createElement_tag(String tag)
-      native "return document.createElement(tag)";
+  static Element createElement_tag(String tag) =>
+      JS('Element', 'document.createElement(#)', tag);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -12548,33 +12557,6 @@
 
 // WARNING: Do not edit - generated code.
 
-/// @domName Entity
-abstract class Entity implements Node {
-
-  /** @domName Entity.notationName */
-  abstract String get notationName;
-
-  /** @domName Entity.publicId */
-  abstract String get publicId;
-
-  /** @domName Entity.systemId */
-  abstract String get systemId;
-}
-
-class _EntityImpl extends _NodeImpl implements Entity native "*Entity" {
-
-  final String notationName;
-
-  final String publicId;
-
-  final String systemId;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
 /// @domName EntityReference
 abstract class EntityReference implements Node {
 }
@@ -12587,7 +12569,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool EntriesCallback(List<Entry> entries);
+typedef void EntriesCallback(List<Entry> entries);
 // Copyright (c) 2012, 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.
@@ -12635,7 +12617,7 @@
 
   final int length;
 
-  _EntryImpl operator[](int index) native "return this[index];";
+  _EntryImpl operator[](int index) => JS("_EntryImpl", "#[#]", this, index);
 
   void operator[]=(int index, _EntryImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -12666,6 +12648,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Entry element) => _Collections.contains(this, element);
+
   void forEach(void f(Entry element)) => _Collections.forEach(this, f);
 
   Collection map(f(Entry element)) => _Collections.map(this, [], f);
@@ -12681,7 +12665,7 @@
 
   // From List<Entry>:
 
-  void sort(int compare(Entry a, Entry b)) {
+  void sort([Comparator<Entry> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -12723,7 +12707,7 @@
 
   final int length;
 
-  _EntrySyncImpl operator[](int index) native "return this[index];";
+  _EntrySyncImpl operator[](int index) => JS("_EntrySyncImpl", "#[#]", this, index);
 
   void operator[]=(int index, _EntrySyncImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -12754,6 +12738,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(EntrySync element) => _Collections.contains(this, element);
+
   void forEach(void f(EntrySync element)) => _Collections.forEach(this, f);
 
   Collection map(f(EntrySync element)) => _Collections.map(this, [], f);
@@ -12769,7 +12755,7 @@
 
   // From List<EntrySync>:
 
-  void sort(int compare(EntrySync a, EntrySync b)) {
+  void sort([Comparator<EntrySync> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -12812,7 +12798,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool EntryCallback(Entry entry);
+typedef void EntryCallback(Entry entry);
 
 class _EntryImpl implements Entry native "*Entry" {
 
@@ -12911,7 +12897,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool ErrorCallback(FileError error);
+typedef void ErrorCallback(FileError error);
 // Copyright (c) 2012, 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.
@@ -13093,7 +13079,7 @@
   final _ClipboardImpl clipboardData;
 
   EventTarget get currentTarget => _convertNativeToDart_EventTarget(this._currentTarget);
-  EventTarget get _currentTarget() native "return this.currentTarget;";
+  EventTarget get _currentTarget() => JS("EventTarget", "#.currentTarget", this);
 
   final bool defaultPrevented;
 
@@ -13102,10 +13088,10 @@
   bool returnValue;
 
   EventTarget get srcElement => _convertNativeToDart_EventTarget(this._srcElement);
-  EventTarget get _srcElement() native "return this.srcElement;";
+  EventTarget get _srcElement() => JS("EventTarget", "#.srcElement", this);
 
   EventTarget get target => _convertNativeToDart_EventTarget(this._target);
-  EventTarget get _target() native "return this.target;";
+  EventTarget get _target() => JS("EventTarget", "#.target", this);
 
   final int timeStamp;
 
@@ -13387,7 +13373,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool FileCallback(File file);
+typedef void FileCallback(File file);
 // Copyright (c) 2012, 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.
@@ -13543,7 +13529,7 @@
 
   final int length;
 
-  _FileImpl operator[](int index) native "return this[index];";
+  _FileImpl operator[](int index) => JS("_FileImpl", "#[#]", this, index);
 
   void operator[]=(int index, _FileImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -13574,6 +13560,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(File element) => _Collections.contains(this, element);
+
   void forEach(void f(File element)) => _Collections.forEach(this, f);
 
   Collection map(f(File element)) => _Collections.map(this, [], f);
@@ -13589,7 +13577,7 @@
 
   // From List<File>:
 
-  void sort(int compare(File a, File b)) {
+  void sort([Comparator<File> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -13780,7 +13768,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool FileSystemCallback(DOMFileSystem fileSystem);
+typedef void FileSystemCallback(DOMFileSystem fileSystem);
 // Copyright (c) 2012, 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.
@@ -13855,7 +13843,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool FileWriterCallback(FileWriter fileWriter);
+typedef void FileWriterCallback(FileWriter fileWriter);
 
 class _FileWriterImpl extends _EventTargetImpl implements FileWriter native "*FileWriter" {
 
@@ -13971,9 +13959,9 @@
 
   final int length;
 
-  num operator[](int index) native "return this[index];";
+  num operator[](int index) => JS("num", "#[#]", this, index);
 
-  void operator[]=(int index, num value) native "this[index] = value";
+  void operator[]=(int index, num value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<num> mixins.
   // num is the element type.
 
@@ -14000,6 +13988,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(num element) => _Collections.contains(this, element);
+
   void forEach(void f(num element)) => _Collections.forEach(this, f);
 
   Collection map(f(num element)) => _Collections.map(this, [], f);
@@ -14015,7 +14005,7 @@
 
   // From List<num>:
 
-  void sort(int compare(num a, num b)) {
+  void sort([Comparator<num> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14088,9 +14078,9 @@
 
   final int length;
 
-  num operator[](int index) native "return this[index];";
+  num operator[](int index) => JS("num", "#[#]", this, index);
 
-  void operator[]=(int index, num value) native "this[index] = value";
+  void operator[]=(int index, num value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<num> mixins.
   // num is the element type.
 
@@ -14117,6 +14107,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(num element) => _Collections.contains(this, element);
+
   void forEach(void f(num element)) => _Collections.forEach(this, f);
 
   Collection map(f(num element)) => _Collections.map(this, [], f);
@@ -14132,7 +14124,7 @@
 
   // From List<num>:
 
-  void sort(int compare(num a, num b)) {
+  void sort([Comparator<num> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14358,7 +14350,7 @@
   final _DocumentImpl contentDocument;
 
   Window get contentWindow => _convertNativeToDart_Window(this._contentWindow);
-  Window get _contentWindow() native "return this.contentWindow;";
+  Window get _contentWindow() => JS("Window", "#.contentWindow", this);
 
   String frameBorder;
 
@@ -14515,7 +14507,7 @@
 
   final int length;
 
-  _GamepadImpl operator[](int index) native "return this[index];";
+  _GamepadImpl operator[](int index) => JS("_GamepadImpl", "#[#]", this, index);
 
   void operator[]=(int index, _GamepadImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -14546,6 +14538,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Gamepad element) => _Collections.contains(this, element);
+
   void forEach(void f(Gamepad element)) => _Collections.forEach(this, f);
 
   Collection map(f(Gamepad element)) => _Collections.map(this, [], f);
@@ -14561,7 +14555,7 @@
 
   // From List<Gamepad>:
 
-  void sort(int compare(Gamepad a, Gamepad b)) {
+  void sort([Comparator<Gamepad> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14707,7 +14701,7 @@
 
   final int length;
 
-  _NodeImpl operator[](int index) native "return this[index];";
+  _NodeImpl operator[](int index) => JS("_NodeImpl", "#[#]", this, index);
 
   void operator[]=(int index, _NodeImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -14738,6 +14732,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -14753,7 +14749,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14817,7 +14813,7 @@
 
   final int length;
 
-  _NodeImpl operator[](int index) native "return this[index];";
+  _NodeImpl operator[](int index) => JS("_NodeImpl", "#[#]", this, index);
 
   void operator[]=(int index, _NodeImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -14848,6 +14844,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -14863,7 +14861,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14924,9 +14922,11 @@
 class _HTMLOptionsCollectionImpl extends _HTMLCollectionImpl implements HTMLOptionsCollection native "*HTMLOptionsCollection" {
 
   // Shadowing definition.
-  int get length() native "return this.length;";
+  int get length() => JS("int", "#.length", this);
 
-  void set length(int value) native "this.length = value;";
+  void set length(int value) {
+    JS("void", "#.length = #", this, value);
+  }
 
   int selectedIndex;
 
@@ -15371,10 +15371,10 @@
   final String direction;
 
   Dynamic get key => _convertNativeToDart_IDBKey(this._key);
-  Dynamic get _key() native "return this.key;";
+  Dynamic get _key() => JS("Dynamic", "#.key", this);
 
   Dynamic get primaryKey => _convertNativeToDart_IDBKey(this._primaryKey);
-  Dynamic get _primaryKey() native "return this.primaryKey;";
+  Dynamic get _primaryKey() => JS("Dynamic", "#.primaryKey", this);
 
   final Dynamic source;
 
@@ -15394,7 +15394,7 @@
 
   _IDBRequestImpl delete() native;
 
-  _IDBRequestImpl update(value) {
+  _IDBRequestImpl update(/*any*/ value) {
     var value_1 = _convertDartToNative_SerializedScriptValue(value);
     return _update_1(value_1);
   }
@@ -15416,7 +15416,7 @@
 class _IDBCursorWithValueImpl extends _IDBCursorImpl implements IDBCursorWithValue native "*IDBCursorWithValue" {
 
   Dynamic get value => _convertNativeToDart_IDBAny(this._value);
-  Dynamic get _value() native "return this.value;";
+  Dynamic get _value() => JS("Dynamic", "#.value", this);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -15543,8 +15543,8 @@
       throw new ArgumentError(mode);
     }
 
-    // TODO(sra): Ensure storeName_OR_storeNames is a string, List<String> or
-    // DOMStringList, and copy to JavaScript array if necessary.
+    // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
+    // and copy to JavaScript array if necessary.
 
     if (_transaction_fn != null) {
       return _transaction_fn(this, storeName_OR_storeNames, mode);
@@ -15576,7 +15576,8 @@
 
   _IDBTransactionImpl _transaction(stores, mode) native 'transaction';
 
-  static bool _hasNumericMode(txn) native 'return typeof(txn.mode) === "number"';
+  static bool _hasNumericMode(txn) =>
+      JS('bool', 'typeof(#.mode) === "number"', txn);
 
 
   _IDBDatabaseEventsImpl get on =>
@@ -15584,7 +15585,7 @@
 
   final String name;
 
-  final List<String> objectStoreNames;
+  final _DOMStringListImpl objectStoreNames;
 
   final Dynamic version;
 
@@ -15648,7 +15649,7 @@
 
 class _IDBFactoryImpl implements IDBFactory native "*IDBFactory" {
 
-  int cmp(first, second) {
+  int cmp(/*IDBKey*/ first, /*IDBKey*/ second) {
     var first_1 = _convertDartToNative_IDBKey(first);
     var second_2 = _convertDartToNative_IDBKey(second);
     return _cmp_1(first_1, second_2);
@@ -15936,16 +15937,16 @@
 class _IDBKeyRangeImpl implements IDBKeyRange native "*IDBKeyRange" {
 
   Dynamic get lower => _convertNativeToDart_IDBKey(this._lower);
-  Dynamic get _lower() native "return this.lower;";
+  Dynamic get _lower() => JS("Dynamic", "#.lower", this);
 
   final bool lowerOpen;
 
   Dynamic get upper => _convertNativeToDart_IDBKey(this._upper);
-  Dynamic get _upper() native "return this.upper;";
+  Dynamic get _upper() => JS("Dynamic", "#.upper", this);
 
   final bool upperOpen;
 
-  static _IDBKeyRangeImpl bound_(lower, upper, [lowerOpen, upperOpen]) {
+  static _IDBKeyRangeImpl bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [lowerOpen, upperOpen]) {
     if (?upperOpen) {
       var lower_1 = _convertDartToNative_IDBKey(lower);
       var upper_2 = _convertDartToNative_IDBKey(upper);
@@ -15964,7 +15965,7 @@
   _IDBKeyRangeImpl _bound__2(lower, upper, bool lowerOpen) native "bound";
   _IDBKeyRangeImpl _bound__3(lower, upper) native "bound";
 
-  static _IDBKeyRangeImpl lowerBound_(bound, [open]) {
+  static _IDBKeyRangeImpl lowerBound_(/*IDBKey*/ bound, [open]) {
     if (?open) {
       var bound_1 = _convertDartToNative_IDBKey(bound);
       return _lowerBound__1(bound_1, open);
@@ -15975,13 +15976,13 @@
   _IDBKeyRangeImpl _lowerBound__1(bound, bool open) native "lowerBound";
   _IDBKeyRangeImpl _lowerBound__2(bound) native "lowerBound";
 
-  static _IDBKeyRangeImpl only_(value) {
+  static _IDBKeyRangeImpl only_(/*IDBKey*/ value) {
     var value_1 = _convertDartToNative_IDBKey(value);
     return _only__1(value_1);
   }
   _IDBKeyRangeImpl _only__1(value) native "only";
 
-  static _IDBKeyRangeImpl upperBound_(bound, [open]) {
+  static _IDBKeyRangeImpl upperBound_(/*IDBKey*/ bound, [open]) {
     if (?open) {
       var bound_1 = _convertDartToNative_IDBKey(bound);
       return _upperBound__1(bound_1, open);
@@ -16051,7 +16052,7 @@
 
   final bool autoIncrement;
 
-  final List<String> indexNames;
+  final _DOMStringListImpl indexNames;
 
   final Dynamic keyPath;
 
@@ -16059,7 +16060,7 @@
 
   final _IDBTransactionImpl transaction;
 
-  _IDBRequestImpl add(value, [key]) {
+  _IDBRequestImpl add(/*any*/ value, [key]) {
     if (?key) {
       var value_1 = _convertDartToNative_SerializedScriptValue(value);
       var key_2 = _convertDartToNative_IDBKey(key);
@@ -16200,7 +16201,7 @@
   _IDBRequestImpl _openCursor_8(_IDBKeyRangeImpl range, int direction) native "openCursor";
   _IDBRequestImpl _openCursor_9(key, int direction) native "openCursor";
 
-  _IDBRequestImpl put(value, [key]) {
+  _IDBRequestImpl put(/*any*/ value, [key]) {
     if (?key) {
       var value_1 = _convertDartToNative_SerializedScriptValue(value);
       var key_2 = _convertDartToNative_IDBKey(key);
@@ -16319,7 +16320,7 @@
   final String readyState;
 
   Dynamic get result => _convertNativeToDart_IDBAny(this._result);
-  Dynamic get _result() native "return this.result;";
+  Dynamic get _result() => JS("Dynamic", "#.result", this);
 
   final Dynamic source;
 
@@ -16563,7 +16564,7 @@
   String align;
 
   Window get contentWindow => _convertNativeToDart_Window(this._contentWindow);
-  Window get _contentWindow() native "return this.contentWindow;";
+  Window get _contentWindow() => JS("Window", "#.contentWindow", this);
 
   String frameBorder;
 
@@ -16595,7 +16596,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool IceCallback(IceCandidate candidate, bool moreToFollow, PeerConnection00 source);
+typedef void IceCallback(IceCandidate candidate, bool moreToFollow, PeerConnection00 source);
 // Copyright (c) 2012, 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.
@@ -16656,7 +16657,7 @@
 /// @domName HTMLImageElement
 abstract class ImageElement implements Element {
 
-  factory ImageElement([String src, int width, int height]) {
+  factory ImageElement({String src, int width, int height}) {
     if (!?src) {
       return _Elements.createImageElement();
     }
@@ -16776,7 +16777,7 @@
 /// @domName HTMLInputElement
 abstract class InputElement implements Element {
 
-  factory InputElement([String type]) {
+  factory InputElement({String type}) {
     if (!?type) {
       return _Elements.createInputElement();
     }
@@ -17114,9 +17115,9 @@
 
   final int length;
 
-  int operator[](int index) native "return this[index];";
+  int operator[](int index) => JS("int", "#[#]", this, index);
 
-  void operator[]=(int index, int value) native "this[index] = value";
+  void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<int> mixins.
   // int is the element type.
 
@@ -17143,6 +17144,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -17158,7 +17161,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -17231,9 +17234,9 @@
 
   final int length;
 
-  int operator[](int index) native "return this[index];";
+  int operator[](int index) => JS("int", "#[#]", this, index);
 
-  void operator[]=(int index, int value) native "this[index] = value";
+  void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<int> mixins.
   // int is the element type.
 
@@ -17260,6 +17263,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -17275,7 +17280,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -17348,9 +17353,9 @@
 
   final int length;
 
-  int operator[](int index) native "return this[index];";
+  int operator[](int index) => JS("int", "#[#]", this, index);
 
-  void operator[]=(int index, int value) native "this[index] = value";
+  void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<int> mixins.
   // int is the element type.
 
@@ -17377,6 +17382,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -17392,7 +17399,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -17930,7 +17937,7 @@
 
 class _LocalLocationImpl implements LocalLocation native "*Location" {
 
-  final List<String> ancestorOrigins;
+  final _DOMStringListImpl ancestorOrigins;
 
   String hash;
 
@@ -18458,11 +18465,12 @@
 
 class _LocalWindowImpl extends _EventTargetImpl implements LocalWindow native "@*DOMWindow" {
 
-  _DocumentImpl get document() native "return this.document;";
+  _DocumentImpl get document() => JS('_DocumentImpl', '#.document', this);
 
-  Window _open2(url, name) native "return this.open(url, name);";
+  Window _open2(url, name) => JS('Window', '#.open(#,#)', this, url, name);
 
-  Window _open3(url, name, options) native "return this.open(url, name, options);";
+  Window _open3(url, name, options) =>
+      JS('Window', '#.open(#,#,#)', this, url, name, options);
 
   Window open(String url, String name, [String options]) {
     if (options == null) {
@@ -18507,8 +18515,10 @@
   var _location_wrapper;  // Cached wrapped Location object.
 
   // Native getter and setter to access raw Location object.
-  Location get _location() native 'return this.location';
-  void set _location(Location value) native 'this.location = value';
+  Location get _location() => JS('Location', '#.location', this);
+  void set _location(Location value) {
+    JS('void', '#.location = #', this, value);
+  }
   // Prevent compiled from thinking 'location' property is available for a Dart
   // member.
   _protect_location() native 'location';
@@ -18545,29 +18555,39 @@
   void _cancelAnimationFrame(int id)
       native 'cancelAnimationFrame';
 
-  _ensureRequestAnimationFrame() native '''
-   if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
+  _ensureRequestAnimationFrame() {
+    if (JS('bool',
+           '!!(#.requestAnimationFrame && #.cancelAnimationFrame)', this, this))
+      return;
+
+    JS('void',
+       r"""
+  (function($this) {
    var vendors = ['ms', 'moz', 'webkit', 'o'];
-   for (var i = 0; i < vendors.length && !this.requestAnimationFrame; ++i) {
-     this.requestAnimationFrame = this[vendors[i] + 'RequestAnimationFrame'];
-     this.cancelAnimationFrame =
-         this[vendors[i]+'CancelAnimationFrame'] ||
-         this[vendors[i]+'CancelRequestAnimationFrame'];
+   for (var i = 0; i < vendors.length && !$this.requestAnimationFrame; ++i) {
+     $this.requestAnimationFrame = $this[vendors[i] + 'RequestAnimationFrame'];
+     $this.cancelAnimationFrame =
+         $this[vendors[i]+'CancelAnimationFrame'] ||
+         $this[vendors[i]+'CancelRequestAnimationFrame'];
    }
-   if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
-   this.requestAnimationFrame = function(callback) {
+   if ($this.requestAnimationFrame && $this.cancelAnimationFrame) return;
+   $this.requestAnimationFrame = function(callback) {
       return window.setTimeout(function() {
         callback(Date.now());
       }, 16 /* 16ms ~= 60fps */);
    };
-   this.cancelAnimationFrame = function(id) { clearTimeout(id); }
-''';
+   $this.cancelAnimationFrame = function(id) { clearTimeout(id); }
+  })(#)""",
+       this);
+  }
 
 
   _IDBFactoryImpl get indexedDB => _get_indexedDB();
 
-  _IDBFactoryImpl _get_indexedDB() native
-      'return this.indexedDB || this.webkitIndexedDB || this.mozIndexedDB';
+  _IDBFactoryImpl _get_indexedDB() =>
+      JS('_IDBFactoryImpl',
+         '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
+         this, this, this);
 
   // TODO(kasperl): Document these.
   lookupPort(String name) {
@@ -18580,13 +18600,15 @@
     localStorage['dart-port:$name'] = JSON.stringify(serialized);
   }
 
-  String createObjectUrl(object) native '''
-    return (window.URL || window.webkitURL).createObjectURL(object)
-  ''';
+  String createObjectUrl(object) =>
+      JS('String',
+         '(window.URL || window.webkitURL).createObjectURL(#)', object);
 
-  void revokeObjectUrl(String objectUrl) native '''
-    (window.URL || window.webkitURL).revokeObjectURL(objectUrl)
-  ''';
+  void revokeObjectUrl(String objectUrl) {
+    JS('void',
+       '(window.URL || window.webkitURL).revokeObjectURL(#)', objectUrl);
+  }
+
 
   _LocalWindowEventsImpl get on =>
     new _LocalWindowEventsImpl(this);
@@ -18628,7 +18650,7 @@
   final bool offscreenBuffering;
 
   Window get opener => _convertNativeToDart_Window(this._opener);
-  Window get _opener() native "return this.opener;";
+  Window get _opener() => JS("Window", "#.opener", this);
 
   final int outerHeight;
 
@@ -18641,7 +18663,7 @@
   final int pageYOffset;
 
   Window get parent => _convertNativeToDart_Window(this._parent);
-  Window get _parent() native "return this.parent;";
+  Window get _parent() => JS("Window", "#.parent", this);
 
   final _PerformanceImpl performance;
 
@@ -18664,7 +18686,7 @@
   final _BarInfoImpl scrollbars;
 
   Window get self => _convertNativeToDart_Window(this._self);
-  Window get _self() native "return this.self;";
+  Window get _self() => JS("Window", "#.self", this);
 
   final _StorageImpl sessionStorage;
 
@@ -18677,7 +18699,7 @@
   final _BarInfoImpl toolbar;
 
   Window get top => _convertNativeToDart_Window(this._top);
-  Window get _top() native "return this.top;";
+  Window get _top() => JS("Window", "#.top", this);
 
   final _IDBFactoryImpl webkitIndexedDB;
 
@@ -18686,7 +18708,7 @@
   final _StorageInfoImpl webkitStorageInfo;
 
   Window get window => _convertNativeToDart_Window(this._window);
-  Window get _window() native "return this.window;";
+  Window get _window() => JS("Window", "#.window", this);
 
   void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "addEventListener";
 
@@ -18728,7 +18750,7 @@
 
   _DatabaseImpl openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native;
 
-  void postMessage(message, String targetOrigin, [messagePorts]) {
+  void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [messagePorts]) {
     if (?message &&
         !?messagePorts) {
       var message_1 = _convertDartToNative_SerializedScriptValue(message);
@@ -19842,7 +19864,7 @@
 
   final int length;
 
-  _MediaStreamImpl operator[](int index) native "return this[index];";
+  _MediaStreamImpl operator[](int index) => JS("_MediaStreamImpl", "#[#]", this, index);
 
   void operator[]=(int index, _MediaStreamImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -19873,6 +19895,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(MediaStream element) => _Collections.contains(this, element);
+
   void forEach(void f(MediaStream element)) => _Collections.forEach(this, f);
 
   Collection map(f(MediaStream element)) => _Collections.map(this, [], f);
@@ -19888,7 +19912,7 @@
 
   // From List<MediaStream>:
 
-  void sort(int compare(MediaStream a, MediaStream b)) {
+  void sort([Comparator<MediaStream> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -20196,7 +20220,7 @@
 class _MessageEventImpl extends _EventImpl implements MessageEvent native "*MessageEvent" {
 
   Dynamic get data => _convertNativeToDart_SerializedScriptValue(this._data);
-  Dynamic get _data() native "return this.data;";
+  Dynamic get _data() => JS("Dynamic", "#.data", this);
 
   final String lastEventId;
 
@@ -20205,7 +20229,7 @@
   final List ports;
 
   Window get source => _convertNativeToDart_Window(this._source);
-  Window get _source() native "return this.source;";
+  Window get _source() => JS("Window", "#.source", this);
 
   void initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object dataArg, String originArg, String lastEventIdArg, _LocalWindowImpl sourceArg, List messagePorts) native;
 
@@ -20260,7 +20284,7 @@
 
   bool $dom_dispatchEvent(_EventImpl evt) native "dispatchEvent";
 
-  void postMessage(message, [messagePorts]) {
+  void postMessage(/*any*/ message, [messagePorts]) {
     if (?messagePorts) {
       var message_1 = _convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, messagePorts);
@@ -20336,7 +20360,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool MetadataCallback(Metadata metadata);
+typedef void MetadataCallback(Metadata metadata);
 
 class _MetadataImpl implements Metadata native "*Metadata" {
 
@@ -20519,7 +20543,7 @@
   final bool metaKey;
 
   EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._relatedTarget);
-  EventTarget get _relatedTarget() native "return this.relatedTarget;";
+  EventTarget get _relatedTarget() => JS("EventTarget", "#.relatedTarget", this);
 
   final int screenX;
 
@@ -20546,8 +20570,8 @@
 
 
   int get offsetX {
-    if (JS('bool', '!!this.offsetX')) {
-      return this._offsetX;
+  if (JS('bool', '!!#.offsetX', this)) {
+      return JS('int', '#.offsetX', this);
     } else {
       // Firefox does not support offsetX.
       var target = this.target;
@@ -20560,21 +20584,18 @@
   }
 
   int get offsetY {
-    if (JS('bool', '!!this.offsetY')) {
-      return this._offsetY;
+    if (JS('bool', '!!#.offsetY', this)) {
+      return JS('int', '#.offsetY', this);
     } else {
       // Firefox does not support offsetY.
       var target = this.target;
       if (!(target is Element)) {
         throw const UnsupportedOperationException(
-            'offsetX is only supported on elements');
+            'offsetY is only supported on elements');
       }
       return this.clientY - this.target.getBoundingClientRect().top;
     }
   }
-
-  int get _offsetX() native 'return this.offsetX';
-  int get _offsetY() native 'return this.offsetY';
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -20582,7 +20603,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
+typedef void MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
 // Copyright (c) 2012, 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.
@@ -20649,14 +20670,14 @@
   List<MutationRecord> takeRecords();
 
   void observe(Node target,
-               [Map options,
+               {Map options,
                 bool childList,
                 bool attributes,
                 bool characterData,
                 bool subtree,
                 bool attributeOldValue,
                 bool characterDataOldValue,
-                List<String> attributeFilter]);
+                List<String> attributeFilter});
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -20676,14 +20697,14 @@
   List<MutationRecord> takeRecords() native;
 
   void observe(Node target,
-               [Map options,
+               {Map options,
                 bool childList,
                 bool attributes,
                 bool characterData,
                 bool subtree,
                 bool attributeOldValue,
                 bool characterDataOldValue,
-                List<String> attributeFilter]) {
+                List<String> attributeFilter}) {
 
     // Parse options into map of known type.
     var parsedOptions = _createDict();
@@ -20831,7 +20852,7 @@
 
   final int length;
 
-  _NodeImpl operator[](int index) native "return this[index];";
+  _NodeImpl operator[](int index) => JS("_NodeImpl", "#[#]", this, index);
 
   void operator[]=(int index, _NodeImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -20862,6 +20883,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -20877,7 +20900,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -21069,7 +21092,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
+typedef void NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
 
 class _NavigatorUserMediaErrorImpl implements NavigatorUserMediaError native "*NavigatorUserMediaError" {
 
@@ -21081,7 +21104,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
+typedef void NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
 // Copyright (c) 2012, 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.
@@ -21306,6 +21329,8 @@
 
   // TODO(jacobr): We can implement these methods much more efficiently by
   // looking up the nodeList only once instead of once per iteration.
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -21323,7 +21348,7 @@
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw new UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -21393,27 +21418,29 @@
   }
 
 
-  _NamedNodeMapImpl get $dom_attributes() native "return this.attributes;";
+  _NamedNodeMapImpl get $dom_attributes() => JS("_NamedNodeMapImpl", "#.attributes", this);
 
-  List<Node> get $dom_childNodes() native "return this.childNodes;";
+  List<Node> get $dom_childNodes() => JS("List<Node>", "#.childNodes", this);
 
-  _NodeImpl get $dom_firstChild() native "return this.firstChild;";
+  _NodeImpl get $dom_firstChild() => JS("_NodeImpl", "#.firstChild", this);
 
-  _NodeImpl get $dom_lastChild() native "return this.lastChild;";
+  _NodeImpl get $dom_lastChild() => JS("_NodeImpl", "#.lastChild", this);
 
-  _NodeImpl get nextNode() native "return this.nextSibling;";
+  _NodeImpl get nextNode() => JS("_NodeImpl", "#.nextSibling", this);
 
-  int get $dom_nodeType() native "return this.nodeType;";
+  int get $dom_nodeType() => JS("int", "#.nodeType", this);
 
-  _DocumentImpl get document() native "return this.ownerDocument;";
+  _DocumentImpl get document() => JS("_DocumentImpl", "#.ownerDocument", this);
 
-  _NodeImpl get parent() native "return this.parentNode;";
+  _NodeImpl get parent() => JS("_NodeImpl", "#.parentNode", this);
 
-  _NodeImpl get previousNode() native "return this.previousSibling;";
+  _NodeImpl get previousNode() => JS("_NodeImpl", "#.previousSibling", this);
 
-  String get text() native "return this.textContent;";
+  String get text() => JS("String", "#.textContent", this);
 
-  void set text(String value) native "this.textContent = value;";
+  void set text(String value) {
+    JS("void", "#.textContent = #", this, value);
+  }
 
   void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "addEventListener";
 
@@ -21526,6 +21553,8 @@
 
   Iterator<E> iterator() => _list.iterator();
 
+  bool contains(E element) => _list.contains(element);
+
   void forEach(void f(E element)) => _list.forEach(f);
 
   Collection map(f(E element)) => _list.map(f);
@@ -21552,7 +21581,7 @@
 
   void addAll(Collection<E> collection) => _list.addAll(collection);
 
-  void sort(int compare(E a, E b)) => _list.sort(compare);
+  void sort([Comparator<E> compare = Comparable.compare]) => _list.sort(compare);
 
   int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
 
@@ -21641,6 +21670,8 @@
     _parent.$dom_replaceChild(value, this[index]);
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -21656,7 +21687,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw new UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -21687,7 +21718,7 @@
 
   final int length;
 
-  _NodeImpl operator[](int index) native "return this[index];";
+  _NodeImpl operator[](int index) => JS("_NodeImpl", "#[#]", this, index);
 
   _NodeImpl _item(int index) native "item";
 
@@ -21861,7 +21892,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool NotificationPermissionCallback(String permission);
+typedef void NotificationPermissionCallback(String permission);
 // Copyright (c) 2012, 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.
@@ -22882,7 +22913,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool PositionCallback(Geoposition position);
+typedef void PositionCallback(Geoposition position);
 // Copyright (c) 2012, 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.
@@ -22910,7 +22941,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool PositionErrorCallback(PositionError error);
+typedef void PositionErrorCallback(PositionError error);
 
 class _PositionErrorImpl implements PositionError native "*PositionError" {
 
@@ -23080,7 +23111,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool RTCErrorCallback(String errorInformation);
+typedef void RTCErrorCallback(String errorInformation);
 // Copyright (c) 2012, 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.
@@ -23328,7 +23359,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool RTCSessionDescriptionCallback(RTCSessionDescription sdp);
+typedef void RTCSessionDescriptionCallback(RTCSessionDescription sdp);
 
 class _RTCSessionDescriptionImpl implements RTCSessionDescription native "*RTCSessionDescription" {
 
@@ -23342,7 +23373,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool RTCStatsCallback(RTCStatsResponse response);
+typedef void RTCStatsCallback(RTCStatsResponse response);
 // Copyright (c) 2012, 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.
@@ -23854,7 +23885,7 @@
 
   final int length;
 
-  Map operator[](int index) native "return this[index];";
+  Map operator[](int index) => JS("Map", "#[#]", this, index);
 
   void operator[]=(int index, Map value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -23885,6 +23916,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Map element) => _Collections.contains(this, element);
+
   void forEach(void f(Map element)) => _Collections.forEach(this, f);
 
   Collection map(f(Map element)) => _Collections.map(this, [], f);
@@ -23900,7 +23933,7 @@
 
   // From List<Map>:
 
-  void sort(int compare(Map a, Map b)) {
+  void sort([Comparator<Map> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -23946,14 +23979,14 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLStatementCallback(SQLTransaction transaction, SQLResultSet resultSet);
+typedef void SQLStatementCallback(SQLTransaction transaction, SQLResultSet resultSet);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLStatementErrorCallback(SQLTransaction transaction, SQLError error);
+typedef void SQLStatementErrorCallback(SQLTransaction transaction, SQLError error);
 // Copyright (c) 2012, 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.
@@ -23972,14 +24005,14 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLTransactionCallback(SQLTransaction transaction);
+typedef void SQLTransactionCallback(SQLTransaction transaction);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLTransactionErrorCallback(SQLError error);
+typedef void SQLTransactionErrorCallback(SQLError error);
 
 class _SQLTransactionImpl implements SQLTransaction native "*SQLTransaction" {
 
@@ -24003,7 +24036,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLTransactionSyncCallback(SQLTransactionSync transaction);
+typedef void SQLTransactionSyncCallback(SQLTransactionSync transaction);
 
 class _SQLTransactionSyncImpl implements SQLTransactionSync native "*SQLTransactionSync" {
 
@@ -24052,7 +24085,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -24359,7 +24392,7 @@
 
   final _SVGLengthListImpl baseVal;
 
-  _SVGAnimatedLengthImpl operator[](int index) native "return this[index];";
+  _SVGAnimatedLengthImpl operator[](int index) => JS("_SVGAnimatedLengthImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGAnimatedLengthImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -24390,6 +24423,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGAnimatedLength element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGAnimatedLength element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGAnimatedLength element)) => _Collections.map(this, [], f);
@@ -24405,7 +24440,7 @@
 
   // From List<SVGAnimatedLength>:
 
-  void sort(int compare(SVGAnimatedLength a, SVGAnimatedLength b)) {
+  void sort([Comparator<SVGAnimatedLength> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -24484,7 +24519,7 @@
 
   final _SVGNumberListImpl baseVal;
 
-  _SVGAnimatedNumberImpl operator[](int index) native "return this[index];";
+  _SVGAnimatedNumberImpl operator[](int index) => JS("_SVGAnimatedNumberImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGAnimatedNumberImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -24515,6 +24550,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGAnimatedNumber element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGAnimatedNumber element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGAnimatedNumber element)) => _Collections.map(this, [], f);
@@ -24530,7 +24567,7 @@
 
   // From List<SVGAnimatedNumber>:
 
-  void sort(int compare(SVGAnimatedNumber a, SVGAnimatedNumber b)) {
+  void sort([Comparator<SVGAnimatedNumber> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -24653,7 +24690,7 @@
 
   final _SVGTransformListImpl baseVal;
 
-  _SVGAnimateTransformElementImpl operator[](int index) native "return this[index];";
+  _SVGAnimateTransformElementImpl operator[](int index) => JS("_SVGAnimateTransformElementImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGAnimateTransformElementImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -24684,6 +24721,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGAnimateTransformElement element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGAnimateTransformElement element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGAnimateTransformElement element)) => _Collections.map(this, [], f);
@@ -24699,7 +24738,7 @@
 
   // From List<SVGAnimateTransformElement>:
 
-  void sort(int compare(SVGAnimateTransformElement a, SVGAnimateTransformElement b)) {
+  void sort([Comparator<SVGAnimateTransformElement> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -24839,7 +24878,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -24903,7 +24942,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25106,7 +25145,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25151,7 +25190,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25262,9 +25301,11 @@
 
 
   // Shadowing definition.
-  String get id() native "return this.id;";
+  String get id() => JS("String", "#.id", this);
 
-  void set id(String value) native "this.id = value;";
+  void set id(String value) {
+    JS("void", "#.id = #", this, value);
+  }
 
   final _SVGSVGElementImpl ownerSVGElement;
 
@@ -25505,7 +25546,7 @@
 
   final int length;
 
-  _SVGElementInstanceImpl operator[](int index) native "return this[index];";
+  _SVGElementInstanceImpl operator[](int index) => JS("_SVGElementInstanceImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGElementInstanceImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -25536,6 +25577,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGElementInstance element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGElementInstance element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGElementInstance element)) => _Collections.map(this, [], f);
@@ -25551,7 +25594,7 @@
 
   // From List<SVGElementInstance>:
 
-  void sort(int compare(SVGElementInstance a, SVGElementInstance b)) {
+  void sort([Comparator<SVGElementInstance> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -25642,7 +25685,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25770,7 +25813,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25828,7 +25871,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25866,7 +25909,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -25948,7 +25991,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26049,7 +26092,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26107,7 +26150,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26175,7 +26218,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26260,7 +26303,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26293,7 +26336,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26394,7 +26437,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26446,7 +26489,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26479,7 +26522,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26560,7 +26603,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26608,7 +26651,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26688,7 +26731,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26778,7 +26821,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26853,7 +26896,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -26933,7 +26976,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27105,7 +27148,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27164,7 +27207,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27249,7 +27292,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27301,7 +27344,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27383,7 +27426,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27525,7 +27568,7 @@
 
   final int numberOfItems;
 
-  _SVGLengthImpl operator[](int index) native "return this[index];";
+  _SVGLengthImpl operator[](int index) => JS("_SVGLengthImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGLengthImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -27556,6 +27599,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGLength element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGLength element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGLength element)) => _Collections.map(this, [], f);
@@ -27571,7 +27616,7 @@
 
   // From List<SVGLength>:
 
-  void sort(int compare(SVGLength a, SVGLength b)) {
+  void sort([Comparator<SVGLength> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -27674,7 +27719,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27859,7 +27904,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -27936,7 +27981,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -28119,7 +28164,7 @@
 
   final int numberOfItems;
 
-  _SVGNumberImpl operator[](int index) native "return this[index];";
+  _SVGNumberImpl operator[](int index) => JS("_SVGNumberImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGNumberImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -28150,6 +28195,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGNumber element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGNumber element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGNumber element)) => _Collections.map(this, [], f);
@@ -28165,7 +28212,7 @@
 
   // From List<SVGNumber>:
 
-  void sort(int compare(SVGNumber a, SVGNumber b)) {
+  void sort([Comparator<SVGNumber> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -28435,7 +28482,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -29034,7 +29081,7 @@
 
   final int numberOfItems;
 
-  _SVGPathSegImpl operator[](int index) native "return this[index];";
+  _SVGPathSegImpl operator[](int index) => JS("_SVGPathSegImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGPathSegImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -29065,6 +29112,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGPathSeg element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGPathSeg element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGPathSeg element)) => _Collections.map(this, [], f);
@@ -29080,7 +29129,7 @@
 
   // From List<SVGPathSeg>:
 
-  void sort(int compare(SVGPathSeg a, SVGPathSeg b)) {
+  void sort([Comparator<SVGPathSeg> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -29246,7 +29295,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -29382,7 +29431,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -29451,7 +29500,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -29648,7 +29697,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -29933,7 +29982,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -30020,7 +30069,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -30065,7 +30114,7 @@
 
   final int numberOfItems;
 
-  String operator[](int index) native "return this[index];";
+  String operator[](int index) => JS("String", "#[#]", this, index);
 
   void operator[]=(int index, String value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -30096,6 +30145,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(String element) => _Collections.contains(this, element);
+
   void forEach(void f(String element)) => _Collections.forEach(this, f);
 
   Collection map(f(String element)) => _Collections.map(this, [], f);
@@ -30111,7 +30162,7 @@
 
   // From List<String>:
 
-  void sort(int compare(String a, String b)) {
+  void sort([Comparator<String> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -30207,9 +30258,11 @@
   String media;
 
   // Shadowing definition.
-  String get title() native "return this.title;";
+  String get title() => JS("String", "#.title", this);
 
-  void set title(String value) native "this.title = value;";
+  void set title(String value) {
+    JS("void", "#.title = #", this, value);
+  }
 
   String type;
 
@@ -30253,7 +30306,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -30302,7 +30355,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -30459,7 +30512,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -30596,7 +30649,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -30718,7 +30771,7 @@
 
   final int numberOfItems;
 
-  _SVGTransformImpl operator[](int index) native "return this[index];";
+  _SVGTransformImpl operator[](int index) => JS("_SVGTransformImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SVGTransformImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -30749,6 +30802,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGTransform element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGTransform element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGTransform element)) => _Collections.map(this, [], f);
@@ -30764,7 +30819,7 @@
 
   // From List<SVGTransform>:
 
-  void sort(int compare(SVGTransform a, SVGTransform b)) {
+  void sort([Comparator<SVGTransform> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -30927,7 +30982,7 @@
 
   // From SVGStylable
 
-  _SVGAnimatedStringImpl get $dom_svgClassName() native "return this.className;";
+  _SVGAnimatedStringImpl get $dom_svgClassName() => JS("_SVGAnimatedStringImpl", "#.className", this);
 
   // Use implementation from Element.
   // final _CSSStyleDeclarationImpl style;
@@ -31657,7 +31712,7 @@
 
   final int length;
 
-  _SourceBufferImpl operator[](int index) native "return this[index];";
+  _SourceBufferImpl operator[](int index) => JS("_SourceBufferImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SourceBufferImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -31688,6 +31743,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SourceBuffer element) => _Collections.contains(this, element);
+
   void forEach(void f(SourceBuffer element)) => _Collections.forEach(this, f);
 
   Collection map(f(SourceBuffer element)) => _Collections.map(this, [], f);
@@ -31703,7 +31760,7 @@
 
   // From List<SourceBuffer>:
 
-  void sort(int compare(SourceBuffer a, SourceBuffer b)) {
+  void sort([Comparator<SourceBuffer> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -31841,7 +31898,7 @@
 
   final int length;
 
-  _SpeechGrammarImpl operator[](int index) native "return this[index];";
+  _SpeechGrammarImpl operator[](int index) => JS("_SpeechGrammarImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SpeechGrammarImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -31872,6 +31929,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SpeechGrammar element) => _Collections.contains(this, element);
+
   void forEach(void f(SpeechGrammar element)) => _Collections.forEach(this, f);
 
   Collection map(f(SpeechGrammar element)) => _Collections.map(this, [], f);
@@ -31887,7 +31946,7 @@
 
   // From List<SpeechGrammar>:
 
-  void sort(int compare(SpeechGrammar a, SpeechGrammar b)) {
+  void sort([Comparator<SpeechGrammar> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -31972,7 +32031,7 @@
 
   final int length;
 
-  _SpeechInputResultImpl operator[](int index) native "return this[index];";
+  _SpeechInputResultImpl operator[](int index) => JS("_SpeechInputResultImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SpeechInputResultImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -32003,6 +32062,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SpeechInputResult element) => _Collections.contains(this, element);
+
   void forEach(void f(SpeechInputResult element)) => _Collections.forEach(this, f);
 
   Collection map(f(SpeechInputResult element)) => _Collections.map(this, [], f);
@@ -32018,7 +32079,7 @@
 
   // From List<SpeechInputResult>:
 
-  void sort(int compare(SpeechInputResult a, SpeechInputResult b)) {
+  void sort([Comparator<SpeechInputResult> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -32297,7 +32358,7 @@
 
   final _DocumentImpl emma;
 
-  bool get finalValue() native "return this.final;";
+  bool get finalValue() => JS("bool", "#.final", this);
 
   final int length;
 
@@ -32308,7 +32369,7 @@
 
   final int length;
 
-  _SpeechRecognitionResultImpl operator[](int index) native "return this[index];";
+  _SpeechRecognitionResultImpl operator[](int index) => JS("_SpeechRecognitionResultImpl", "#[#]", this, index);
 
   void operator[]=(int index, _SpeechRecognitionResultImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -32339,6 +32400,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SpeechRecognitionResult element) => _Collections.contains(this, element);
+
   void forEach(void f(SpeechRecognitionResult element)) => _Collections.forEach(this, f);
 
   Collection map(f(SpeechRecognitionResult element)) => _Collections.map(this, [], f);
@@ -32354,7 +32417,7 @@
 
   // From List<SpeechRecognitionResult>:
 
-  void sort(int compare(SpeechRecognitionResult a, SpeechRecognitionResult b)) {
+  void sort([Comparator<SpeechRecognitionResult> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -32512,7 +32575,7 @@
 
   bool isEmpty() => $dom_key(0) == null;
 
-  int get $dom_length() native "return this.length;";
+  int get $dom_length() => JS("int", "#.length", this);
 
   void $dom_clear() native "clear";
 
@@ -32550,7 +32613,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StorageInfoErrorCallback(DOMException error);
+typedef void StorageInfoErrorCallback(DOMException error);
 
 class _StorageInfoImpl implements StorageInfo native "*StorageInfo" {
 
@@ -32564,21 +32627,21 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StorageInfoQuotaCallback(int grantedQuotaInBytes);
+typedef void StorageInfoQuotaCallback(int grantedQuotaInBytes);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StorageInfoUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
+typedef void StorageInfoUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StringCallback(String data);
+typedef void StringCallback(String data);
 // Copyright (c) 2012, 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.
@@ -32692,7 +32755,7 @@
 
   final int length;
 
-  _StyleSheetImpl operator[](int index) native "return this[index];";
+  _StyleSheetImpl operator[](int index) => JS("_StyleSheetImpl", "#[#]", this, index);
 
   void operator[]=(int index, _StyleSheetImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -32723,6 +32786,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(StyleSheet element) => _Collections.contains(this, element);
+
   void forEach(void f(StyleSheet element)) => _Collections.forEach(this, f);
 
   Collection map(f(StyleSheet element)) => _Collections.map(this, [], f);
@@ -32738,7 +32803,7 @@
 
   // From List<StyleSheet>:
 
-  void sort(int compare(StyleSheet a, StyleSheet b)) {
+  void sort([Comparator<StyleSheet> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -33584,7 +33649,7 @@
 
   final int length;
 
-  _TextTrackCueImpl operator[](int index) native "return this[index];";
+  _TextTrackCueImpl operator[](int index) => JS("_TextTrackCueImpl", "#[#]", this, index);
 
   void operator[]=(int index, _TextTrackCueImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -33615,6 +33680,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(TextTrackCue element) => _Collections.contains(this, element);
+
   void forEach(void f(TextTrackCue element)) => _Collections.forEach(this, f);
 
   Collection map(f(TextTrackCue element)) => _Collections.map(this, [], f);
@@ -33630,7 +33697,7 @@
 
   // From List<TextTrackCue>:
 
-  void sort(int compare(TextTrackCue a, TextTrackCue b)) {
+  void sort([Comparator<TextTrackCue> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -33745,7 +33812,7 @@
 
   final int length;
 
-  _TextTrackImpl operator[](int index) native "return this[index];";
+  _TextTrackImpl operator[](int index) => JS("_TextTrackImpl", "#[#]", this, index);
 
   void operator[]=(int index, _TextTrackImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -33776,6 +33843,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(TextTrack element) => _Collections.contains(this, element);
+
   void forEach(void f(TextTrack element)) => _Collections.forEach(this, f);
 
   Collection map(f(TextTrack element)) => _Collections.map(this, [], f);
@@ -33791,7 +33860,7 @@
 
   // From List<TextTrack>:
 
-  void sort(int compare(TextTrack a, TextTrack b)) {
+  void sort([Comparator<TextTrack> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34003,7 +34072,7 @@
   final int screenY;
 
   EventTarget get target => _convertNativeToDart_EventTarget(this._target);
-  EventTarget get _target() native "return this.target;";
+  EventTarget get _target() => JS("EventTarget", "#.target", this);
 
   final num webkitForce;
 
@@ -34033,7 +34102,7 @@
 
   final int length;
 
-  _TouchImpl operator[](int index) native "return this[index];";
+  _TouchImpl operator[](int index) => JS("_TouchImpl", "#[#]", this, index);
 
   void operator[]=(int index, _TouchImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -34064,6 +34133,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Touch element) => _Collections.contains(this, element);
+
   void forEach(void f(Touch element)) => _Collections.forEach(this, f);
 
   Collection map(f(Touch element)) => _Collections.map(this, [], f);
@@ -34079,7 +34150,7 @@
 
   // From List<Touch>:
 
-  void sort(int compare(Touch a, Touch b)) {
+  void sort([Comparator<Touch> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34159,9 +34230,11 @@
 
 class _TrackElementImpl extends _ElementImpl implements TrackElement native "*HTMLTrackElement" {
 
-  bool get defaultValue() native "return this.default;";
+  bool get defaultValue() => JS("bool", "#.default", this);
 
-  void set defaultValue(bool value) native "this.default = value;";
+  void set defaultValue(bool value) {
+    JS("void", "#.default = #", this, value);
+  }
 
   String kind;
 
@@ -34343,7 +34416,7 @@
   final int pageY;
 
   Window get view => _convertNativeToDart_Window(this._view);
-  Window get _view() native "return this.view;";
+  Window get _view() => JS("Window", "#.view", this);
 
   final int which;
 
@@ -34407,9 +34480,9 @@
 
   final int length;
 
-  int operator[](int index) native "return this[index];";
+  int operator[](int index) => JS("int", "#[#]", this, index);
 
-  void operator[]=(int index, int value) native "this[index] = value";
+  void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<int> mixins.
   // int is the element type.
 
@@ -34436,6 +34509,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -34451,7 +34526,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34524,9 +34599,9 @@
 
   final int length;
 
-  int operator[](int index) native "return this[index];";
+  int operator[](int index) => JS("int", "#[#]", this, index);
 
-  void operator[]=(int index, int value) native "this[index] = value";
+  void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<int> mixins.
   // int is the element type.
 
@@ -34553,6 +34628,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -34568,7 +34645,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34641,9 +34718,9 @@
 
   final int length;
 
-  int operator[](int index) native "return this[index];";
+  int operator[](int index) => JS("int", "#[#]", this, index);
 
-  void operator[]=(int index, int value) native "this[index] = value";
+  void operator[]=(int index, int value) => JS("void", "#[#] = #", this, index, value);
   // -- start List<int> mixins.
   // int is the element type.
 
@@ -34670,6 +34747,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -34685,7 +34764,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34915,7 +34994,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool VoidCallback();
+typedef void VoidCallback();
 // Copyright (c) 2012, 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.
@@ -36626,7 +36705,7 @@
 
   final int length;
 
-  _AnimationImpl operator[](int index) native "return this[index];";
+  _AnimationImpl operator[](int index) => JS("_AnimationImpl", "#[#]", this, index);
 
   void operator[]=(int index, _AnimationImpl value) {
     throw new UnsupportedOperationException("Cannot assign element of immutable List.");
@@ -36657,6 +36736,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Animation element) => _Collections.contains(this, element);
+
   void forEach(void f(Animation element)) => _Collections.forEach(this, f);
 
   Collection map(f(Animation element)) => _Collections.map(this, [], f);
@@ -36672,7 +36753,7 @@
 
   // From List<Animation>:
 
-  void sort(int compare(Animation a, Animation b)) {
+  void sort([Comparator<Animation> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -37023,12 +37104,12 @@
     return this._deltaMode;
   }
 
-  num get _deltaY() native 'return this.deltaY';
-  num get _deltaX() native 'return this.deltaX';
-  num get _wheelDelta() native 'return this.wheelDelta';
-  num get _wheelDeltaX() native 'return this.wheelDeltaX';
-  num get _detail() native 'return this.detail';
-  int get _deltaMode() native 'return this.deltaMode';
+  num get _deltaY => JS('num', '#.deltaY', this);
+  num get _deltaX => JS('num', '#.deltaX', this);
+  num get _wheelDelta => JS('num', '#.wheelDelta', this);
+  num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this);
+  num get _detail => JS('num', '#.detail', this);
+  int get _deltaMode => JS('int', '#.deltaMode', this);
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -37204,7 +37285,7 @@
   _WorkerEventsImpl get on =>
     new _WorkerEventsImpl(this);
 
-  void postMessage(message, [messagePorts]) {
+  void postMessage(/*SerializedScriptValue*/ message, [messagePorts]) {
     if (?messagePorts) {
       var message_1 = _convertDartToNative_SerializedScriptValue(message);
       _postMessage_1(message_1, messagePorts);
@@ -37573,18 +37654,18 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class _ArrayBufferFactoryProvider {
-  static ArrayBuffer createArrayBuffer(int length) native
-      '''return new ArrayBuffer(length);''';
+  static ArrayBuffer createArrayBuffer(int length) =>
+      JS('ArrayBuffer', 'new ArrayBuffer(#)', length);
 }
 // Copyright (c) 2012, 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 _AudioElementFactoryProvider {
-  static AudioElement createAudioElement([String src = null]) native '''
-      if (src == null) return new Audio();
-      return new Audio(src);
-    ''';
+  static AudioElement createAudioElement([String src = null]) {
+    if (src == null) return JS('AudioElement', 'new Audio()');
+    return JS('AudioElement', 'new Audio(#)', src);
+  }
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -37604,48 +37685,51 @@
     return _create_2(blobParts, bag);
   }
 
-  static _create_1(parts) native 'return new Blob(parts);';
-  static _create_2(parts, bag) native 'return new Blob(parts, bag);';
+  static _create_1(parts) => JS('Blob', 'new Blob(#)', parts);
+  static _create_2(parts, bag) => JS('Blob', 'new Blob(#, #)', parts, bag);
 
-  static _create_bag() native 'return {}';
-  static _bag_set(bag, key, value) native 'bag[key] = value;';
+  static _create_bag() => JS('var', '{}');
+  static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
 }
 // Copyright (c) 2012, 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 _CSSMatrixFactoryProvider {
-  static CSSMatrix createCSSMatrix([String cssValue = '']) native
-      'return new WebKitCSSMatrix(cssValue);';
+  static CSSMatrix createCSSMatrix([String cssValue = '']) =>
+      JS('CSSMatrix', 'new WebKitCSSMatrix(#)', cssValue);
 }
 // Copyright (c) 2012, 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 _DOMParserFactoryProvider {
-  static DOMParser createDOMParser() native
-      '''return new DOMParser();''';
+  static DOMParser createDOMParser() =>
+      JS('DOMParser', 'new DOMParser()' );
 }
 // Copyright (c) 2012, 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 _DOMURLFactoryProvider {
-  static DOMURL createDOMURL() native
-      '''return new DOMURL();''';
+  static DOMURL createDOMURL() =>
+      JS('DOMURL', 'new DOMURL()' );
 }
 // Copyright (c) 2012, 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 _DataViewFactoryProvider {
-  static DataView createDataView(ArrayBuffer buffer,
-      [int byteOffset = null, int byteLength = null])
-      native '''
-          if (byteOffset == null) return new DataView(buffer);
-          if (byteLength == null) return new DataView(buffer, byteOffset);
-          return new DataView(buffer, byteOffset, byteLength);
-      ''';
+  static DataView createDataView(
+      ArrayBuffer buffer, [int byteOffset = null, int byteLength = null]) {
+    if (byteOffset == null) {
+      return JS('DataView', 'new DataView(#)', buffer);
+    }
+    if (byteLength == null) {
+      return JS('DataView', 'new DataView(#,#)', buffer, byteOffset);
+    }
+    return JS('DataView', 'new DataView(#,#,#)', buffer, byteOffset, byteLength);
+  }
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -37956,41 +38040,42 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class _EventSourceFactoryProvider {
-  static EventSource createEventSource(String scriptUrl) native
-      '''return new EventSource(scriptUrl);''';
+  static EventSource createEventSource(String scriptUrl) =>
+      JS('EventSource', 'new EventSource(#)', scriptUrl);
 }
 // Copyright (c) 2012, 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 _FileReaderFactoryProvider {
-  static FileReader createFileReader() native
-      '''return new FileReader();''';
+  static FileReader createFileReader() =>
+      JS('FileReader', 'new FileReader()' );
 }
 // Copyright (c) 2012, 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 _FileReaderSyncFactoryProvider {
-  static FileReaderSync createFileReaderSync() native
-      '''return new FileReaderSync();''';
+  static FileReaderSync createFileReaderSync() =>
+      JS('FileReaderSync', 'new FileReaderSync()' );
 }
 // Copyright (c) 2012, 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 _FormDataFactoryProvider {
-  static FormData createFormData([FormElement form = null]) native '''
-    if (form == null) return new FormData();
-    return new FormData(form);
-  ''';
+  static FormData createFormData([FormElement form = null]) {
+    if (form == null) return JS('FormData', 'new FormData()');
+    return JS('FormData', 'new FormData(#)', form);
+  }
 }
 // Copyright (c) 2012, 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 _HttpRequestFactoryProvider {
-  static HttpRequest createHttpRequest() native 'return new XMLHttpRequest();';
+  static HttpRequest createHttpRequest() =>
+      JS('HttpRequest', 'new XMLHttpRequest();');
 
   static HttpRequest createHttpRequest_get(String url,
       onSuccess(HttpRequest request)) =>
@@ -38005,40 +38090,40 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class _IceCandidateFactoryProvider {
-  static IceCandidate createIceCandidate(String label, String candidateLine) native
-      '''return new IceCandidate(label, candidateLine);''';
+  static IceCandidate createIceCandidate(String label, String candidateLine) =>
+      JS('IceCandidate', 'new IceCandidate(#,#)', label, candidateLine);
 }
 // Copyright (c) 2012, 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 _MediaControllerFactoryProvider {
-  static MediaController createMediaController() native
-      '''return new MediaController();''';
+  static MediaController createMediaController() =>
+      JS('MediaController', 'new MediaController()' );
 }
 // Copyright (c) 2012, 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 _MediaSourceFactoryProvider {
-  static MediaSource createMediaSource() native
-      '''return new MediaSource();''';
+  static MediaSource createMediaSource() =>
+      JS('MediaSource', 'new MediaSource()' );
 }
 // Copyright (c) 2012, 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 _MediaStreamFactoryProvider {
-  static MediaStream createMediaStream(MediaStreamTrackList audioTracks, MediaStreamTrackList videoTracks) native
-      '''return new MediaStream(audioTracks, videoTracks);''';
+  static MediaStream createMediaStream(MediaStreamTrackList audioTracks, MediaStreamTrackList videoTracks) =>
+      JS('MediaStream', 'new MediaStream(#,#)', audioTracks, videoTracks);
 }
 // Copyright (c) 2012, 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 _MessageChannelFactoryProvider {
-  static MessageChannel createMessageChannel() native
-      '''return new MessageChannel();''';
+  static MessageChannel createMessageChannel() =>
+      JS('MessageChannel', 'new MessageChannel()' );
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -38051,14 +38136,24 @@
         window.MozMutationObserver;
     return new constructor(callback);
   ''';
+
+  // TODO(sra): Dart2js inserts a conversion when a Dart function (i.e. an
+  // object with a call method) is passed to a native method.  This is so the
+  // native code sees a JavaScript function.
+  //
+  // This does not happen when a function is 'passed' to a JS-form so it is not
+  // possible to rewrite the above code to, e.g. (simplified):
+  //
+  // static createMutationObserver(MutationCallback callback) =>
+  //    JS('var', 'new (window.MutationObserver)(#)', callback);
 }
 // Copyright (c) 2012, 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 _NotificationFactoryProvider {
-  static Notification createNotification(String title, [Map options]) native
-      '''return new Notification(title, options);''';
+  static Notification createNotification(String title, [Map options]) =>
+      JS('Notification', 'new Notification(#,#)', title, options);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -38066,98 +38161,106 @@
 
 class _OptionElementFactoryProvider {
   static OptionElement createOptionElement(
-      [String data, String value, bool defaultSelected, bool selected])
-      native '''
-          if (data == null) return new Option();
-          if (value == null) return new Option(data);
-          if (defaultSelected == null) return new Option(data, value);
-          if (selected == null) return new Option(data, value, defaultSelected);
-          return new Option(data, value, defaultSelected, selected);
-      ''';
+      [String data, String value, bool defaultSelected, bool selected]) {
+    if (data == null) {
+      return JS('OptionElement', 'new Option()');
+    }
+    if (value == null) {
+      return JS('OptionElement', 'new Option(#)', data);
+    }
+    if (defaultSelected == null) {
+      return JS('OptionElement', 'new Option(#,#)', data, value);
+    }
+    if (selected == null) {
+      return JS('OptionElement', 'new Option(#,#,#)',
+                data, value, defaultSelected);
+    }
+    return JS('OptionElement', 'new Option(#,#,#,#)',
+              data, value, defaultSelected, selected);
+  }
 }
 // Copyright (c) 2012, 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 _PeerConnection00FactoryProvider {
-  static PeerConnection00 createPeerConnection00(String serverConfiguration, IceCallback iceCallback) native
-      '''return new PeerConnection00(serverConfiguration, iceCallback);''';
+  static PeerConnection00 createPeerConnection00(String serverConfiguration, IceCallback iceCallback) =>
+      JS('PeerConnection00', 'new PeerConnection00(#,#)', serverConfiguration, iceCallback);
 }
 // Copyright (c) 2012, 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 _RTCIceCandidateFactoryProvider {
-  static RTCIceCandidate createRTCIceCandidate(Map dictionary) native
-      '''return new RTCIceCandidate(dictionary);''';
+  static RTCIceCandidate createRTCIceCandidate(Map dictionary) =>
+      JS('RTCIceCandidate', 'new RTCIceCandidate(#)', dictionary);
 }
 // Copyright (c) 2012, 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 _RTCPeerConnectionFactoryProvider {
-  static RTCPeerConnection createRTCPeerConnection(Map rtcIceServers, [Map mediaConstraints]) native
-      '''return new RTCPeerConnection(rtcIceServers, mediaConstraints);''';
+  static RTCPeerConnection createRTCPeerConnection(Map rtcIceServers, [Map mediaConstraints]) =>
+      JS('RTCPeerConnection', 'new RTCPeerConnection(#,#)', rtcIceServers, mediaConstraints);
 }
 // Copyright (c) 2012, 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 _RTCSessionDescriptionFactoryProvider {
-  static RTCSessionDescription createRTCSessionDescription(Map dictionary) native
-      '''return new RTCSessionDescription(dictionary);''';
+  static RTCSessionDescription createRTCSessionDescription(Map dictionary) =>
+      JS('RTCSessionDescription', 'new RTCSessionDescription(#)', dictionary);
 }
 // Copyright (c) 2012, 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 _SessionDescriptionFactoryProvider {
-  static SessionDescription createSessionDescription(String sdp) native
-      '''return new SessionDescription(sdp);''';
+  static SessionDescription createSessionDescription(String sdp) =>
+      JS('SessionDescription', 'new SessionDescription(#)', sdp);
 }
 // Copyright (c) 2012, 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 _ShadowRootFactoryProvider {
-  static ShadowRoot createShadowRoot(Element host) native '''
-      return new (window.ShadowRoot || window.WebKitShadowRoot)(host);
-    ''';
+  static ShadowRoot createShadowRoot(Element host) =>
+      JS('ShadowRoot',
+         'new (window.ShadowRoot || window.WebKitShadowRoot)(#)', host);
 }
 // Copyright (c) 2012, 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 _SharedWorkerFactoryProvider {
-  static SharedWorker createSharedWorker(String scriptURL, [String name])
-      native '''
-        if (name == null) return new SharedWorker(scriptURL);
-        return new SharedWorker(scriptURL, name);
-      ''';
+  static SharedWorker createSharedWorker(String scriptURL, [String name]) {
+    if (name == null) return JS('SharedWorker', 'new SharedWorker(#)', scriptURL);
+    return JS('SharedWorker', 'new SharedWorker(#,#)', scriptURL, name);
+  }
 }
 // Copyright (c) 2012, 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 _SpeechGrammarFactoryProvider {
-  static SpeechGrammar createSpeechGrammar() native
-      '''return new SpeechGrammar();''';
+  static SpeechGrammar createSpeechGrammar() =>
+      JS('SpeechGrammar', 'new SpeechGrammar()' );
 }
 // Copyright (c) 2012, 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 _SpeechGrammarListFactoryProvider {
-  static SpeechGrammarList createSpeechGrammarList() native
-      '''return new SpeechGrammarList();''';
+  static SpeechGrammarList createSpeechGrammarList() =>
+      JS('SpeechGrammarList', 'new SpeechGrammarList()' );
 }
 // Copyright (c) 2012, 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 _SpeechRecognitionFactoryProvider {
-  static SpeechRecognition createSpeechRecognition() native
-      '''return new SpeechRecognition();''';
+  static SpeechRecognition createSpeechRecognition() =>
+      JS('SpeechRecognition', 'new SpeechRecognition()' );
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -38166,46 +38269,53 @@
 class _TextTrackCueFactoryProvider {
   static TextTrackCue createTextTrackCue(
       String id, num startTime, num endTime, String text,
-      [String settings, bool pauseOnExit])
-      native '''
-        if (settings == null)
-          return new TextTrackCue(id, startTime, endTime, text);
-        if (pauseOnExit == null)
-          return new TextTrackCue(id, startTime, endTime, text, settings);
-        return new TextTrackCue(id, startTime, endTime, text, settings, pauseOnExit);
-      ''';
+      [String settings, bool pauseOnExit]) {
+        if (settings == null) {
+          return JS('TextTrackCue',
+                    'new TextTrackCue(#,#,#,#)',
+                    id, startTime, endTime, text);
+        }
+        if (pauseOnExit == null) {
+          return JS('TextTrackCue',
+                    'new TextTrackCue(#,#,#,#,#)',
+                    id, startTime, endTime, text, settings);
+        }
+        return JS('TextTrackCue',
+                  'new TextTrackCue(#,#,#,#,#,#)',
+                  id, startTime, endTime, text, settings, pauseOnExit);
+  }
 }
 // Copyright (c) 2012, 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 _WorkerFactoryProvider {
-  static Worker createWorker(String scriptUrl) native
-      '''return new Worker(scriptUrl);''';
+  static Worker createWorker(String scriptUrl) =>
+      JS('Worker', 'new Worker(#)', scriptUrl);
 }
 // Copyright (c) 2012, 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 _XMLSerializerFactoryProvider {
-  static XMLSerializer createXMLSerializer() native
-      '''return new XMLSerializer();''';
+  static XMLSerializer createXMLSerializer() =>
+      JS('XMLSerializer', 'new XMLSerializer()' );
 }
 // Copyright (c) 2012, 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 _XPathEvaluatorFactoryProvider {
-  static XPathEvaluator createXPathEvaluator() native
-      '''return new XPathEvaluator();''';
+  static XPathEvaluator createXPathEvaluator() =>
+      JS('XPathEvaluator', 'new XPathEvaluator()' );
 }
 // Copyright (c) 2012, 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 _XSLTProcessorFactoryProvider {
-  static XSLTProcessor createXSLTProcessor() native
-      '''return new XSLTProcessor();''';
+  static XSLTProcessor createXSLTProcessor() =>
+      JS('XSLTProcessor', 'new XSLTProcessor()' );
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -38843,6 +38953,13 @@
  * method.
  */
 class _Collections {
+  static bool contains(Iterable<Object> iterable, Object element) {
+    for (final e in iterable) {
+      if (e == element) return true;
+    }
+    return false;
+  }
+
   static void forEach(Iterable<Object> iterable, void f(Object o)) {
     for (final e in iterable) {
       f(e);
@@ -39214,7 +39331,7 @@
     // so we just make a dummy event and listen for that.
     _observer = new MutationObserver(this._handleMutation);
     _dummy = new DivElement();
-    _observer.observe(_dummy, {}, attributes: true);
+    _observer.observe(_dummy, attributes: true);
   }
 
   void _schedule() {
@@ -40192,25 +40309,25 @@
 
 class _AudioContextFactoryProvider {
 
-  static AudioContext createAudioContext() native '''
-    var constructor = window.AudioContext || window.webkitAudioContext;
-    return new constructor();
-''';
+  static AudioContext createAudioContext() {
+    return JS('AudioContext',
+              'new (window.AudioContext || window.webkitAudioContext)()');
+  }
 }
 
 class _PointFactoryProvider {
-  static Point createPoint(num x, num y) native
-    'return new WebKitPoint(x, y);';
+  static Point createPoint(num x, num y) =>
+      JS('Point', 'new WebKitPoint(#, #)', x, y);
 }
 
 class _WebSocketFactoryProvider {
-  static WebSocket createWebSocket(String url) native
-      '''return new WebSocket(url);''';
+  static WebSocket createWebSocket(String url) =>
+      JS('WebSocket', 'new WebSocket(#)', url);
 }
 
 class _TextFactoryProvider {
-  static Text createText(String data) native
-      "return document.createTextNode(data);";
+  static Text createText(String data) =>
+      JS('Text', 'document.createTextNode(#)', data);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -40241,25 +40358,25 @@
     return _cachedClass = _uncachedClass();
   }
 
-  static _uncachedClass() native '''
-      return window.webkitIDBKeyRange || window.mozIDBKeyRange ||
-             window.msIDBKeyRange || window.IDBKeyRange;
-  ''';
+  static _uncachedClass() =>
+    JS('var',
+       '''window.webkitIDBKeyRange || window.mozIDBKeyRange ||
+          window.msIDBKeyRange || window.IDBKeyRange''');
 
   static _translateKey(idbkey) => idbkey;  // TODO: fixme.
 
-  static _IDBKeyRangeImpl _only(cls, value) native
-      '''return cls.only(value);''';
+  static _IDBKeyRangeImpl _only(cls, value) =>
+       JS('_IDBKeyRangeImpl', '#.only(#)', cls, value);
 
-  static _IDBKeyRangeImpl _lowerBound(cls, bound, open) native
-      '''return cls.lowerBound(bound, open);''';
+  static _IDBKeyRangeImpl _lowerBound(cls, bound, open) =>
+       JS('_IDBKeyRangeImpl', '#.lowerBound(#, #)', cls, bound, open);
 
-  static _IDBKeyRangeImpl _upperBound(cls, bound, open) native
-      '''return cls.upperBound(bound, open);''';
+  static _IDBKeyRangeImpl _upperBound(cls, bound, open) =>
+       JS('_IDBKeyRangeImpl', '#.upperBound(#, #)', cls, bound, open);
 
-  static _IDBKeyRangeImpl _bound(cls, lower, upper, lowerOpen, upperOpen) native
-      '''return cls.bound(lower, upper, lowerOpen, upperOpen);''';
-
+  static _IDBKeyRangeImpl _bound(cls, lower, upper, lowerOpen, upperOpen) =>
+       JS('_IDBKeyRangeImpl', '#.bound(#, #, #, #)',
+          cls, lower, upper, lowerOpen, upperOpen);
 }
 // 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
@@ -40317,22 +40434,17 @@
   void set search(String value) => _set(_ptr, 'search', value);
 
 
-  void assign(String url) => _assign(_ptr, url);
+  void assign(String url) => JS('void', '#.assign(#)', _ptr, url);
 
-  void reload() => _reload(_ptr);
+  void reload() => JS('void', '#.reload()', _ptr);
 
-  void replace(String url) => _replace(_ptr, url);
+  void replace(String url) => JS('void', '#.replace(#)', _ptr, url);
 
-  String toString() => _toString(_ptr);
+  String toString() => JS('String', '#.toString()', _ptr);
 
 
-  static _get(p, m) native 'return p[m];';
-  static _set(p, m, v) native 'p[m] = v;';
-
-  static _assign(p, url) native 'p.assign(url);';
-  static _reload(p) native 'p.reload()';
-  static _replace(p, url) native 'p.replace(url);';
-  static _toString(p) native 'return p.toString();';
+  static _get(p, m) => JS('var', '#[#]', p, m);
+  static _set(p, m, v) => JS('void', '#[#] = #', p, m, v);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -40342,9 +40454,8 @@
  * Checks to see if the mutation observer API is supported on the current
  * platform.
  */
-bool _isMutationObserverSupported() native '''
-  return !!( window.MutationObserver || window.WebKitMutationObserver);
-''';
+bool _isMutationObserverSupported() =>
+  JS('bool', '!!(window.MutationObserver || window.WebKitMutationObserver)');
 // Copyright (c) 2012, 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.
@@ -40432,35 +40543,62 @@
     return _U8C_3(buffer, byteOffset, length);
   }
 
-  static Float32Array _F32(arg) native 'return new Float32Array(arg);';
-  static Float64Array _F64(arg) native 'return new Float64Array(arg);';
-  static Int8Array _I8(arg) native 'return new Int8Array(arg);';
-  static Int16Array _I16(arg) native 'return new Int16Array(arg);';
-  static Int32Array _I32(arg) native 'return new Int32Array(arg);';
-  static Uint8Array _U8(arg) native 'return new Uint8Array(arg);';
-  static Uint16Array _U16(arg) native 'return new Uint16Array(arg);';
-  static Uint32Array _U32(arg) native 'return new Uint32Array(arg);';
-  static Uint8ClampedArray _U8C(arg) native 'return new Uint8ClampedArray(arg);';
+  static Float32Array _F32(arg) =>
+      JS('Float32Array', 'new Float32Array(#)', arg);
+  static Float64Array _F64(arg) =>
+      JS('Float64Array', 'new Float64Array(#)', arg);
+  static Int8Array _I8(arg) =>
+      JS('Int8Array', 'new Int8Array(#)', arg);
+  static Int16Array _I16(arg) =>
+      JS('Int16Array', 'new Int16Array(#)', arg);
+  static Int32Array _I32(arg) =>
+      JS('Int32Array', 'new Int32Array(#)', arg);
+  static Uint8Array _U8(arg) =>
+      JS('Uint8Array', 'new Uint8Array(#)', arg);
+  static Uint16Array _U16(arg) =>
+      JS('Uint16Array', 'new Uint16Array(#)', arg);
+  static Uint32Array _U32(arg) =>
+      JS('Uint32Array', 'new Uint32Array(#)', arg);
+  static Uint8ClampedArray _U8C(arg) =>
+      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#)', arg);
 
-  static Float32Array _F32_2(arg1, arg2) native 'return new Float32Array(arg1, arg2);';
-  static Float64Array _F64_2(arg1, arg2) native 'return new Float64Array(arg1, arg2);';
-  static Int8Array _I8_2(arg1, arg2) native 'return new Int8Array(arg1, arg2);';
-  static Int16Array _I16_2(arg1, arg2) native 'return new Int16Array(arg1, arg2);';
-  static Int32Array _I32_2(arg1, arg2) native 'return new Int32Array(arg1, arg2);';
-  static Uint8Array _U8_2(arg1, arg2) native 'return new Uint8Array(arg1, arg2);';
-  static Uint16Array _U16_2(arg1, arg2) native 'return new Uint16Array(arg1, arg2);';
-  static Uint32Array _U32_2(arg1, arg2) native 'return new Uint32Array(arg1, arg2);';
-  static Uint8ClampedArray _U8C_2(arg1, arg2) native 'return new Uint8ClampedArray(arg1, arg2);';
+  static Float32Array _F32_2(arg1, arg2) =>
+      JS('Float32Array', 'new Float32Array(#, #)', arg1, arg2);
+  static Float64Array _F64_2(arg1, arg2) =>
+      JS('Float64Array', 'new Float64Array(#, #)', arg1, arg2);
+  static Int8Array _I8_2(arg1, arg2) =>
+      JS('Int8Array', 'new Int8Array(#, #)', arg1, arg2);
+  static Int16Array _I16_2(arg1, arg2) =>
+      JS('Int16Array', 'new Int16Array(#, #)', arg1, arg2);
+  static Int32Array _I32_2(arg1, arg2) =>
+      JS('Int32Array', 'new Int32Array(#, #)', arg1, arg2);
+  static Uint8Array _U8_2(arg1, arg2) =>
+      JS('Uint8Array', 'new Uint8Array(#, #)', arg1, arg2);
+  static Uint16Array _U16_2(arg1, arg2) =>
+      JS('Uint16Array', 'new Uint16Array(#, #)', arg1, arg2);
+  static Uint32Array _U32_2(arg1, arg2) =>
+      JS('Uint32Array', 'new Uint32Array(#, #)', arg1, arg2);
+  static Uint8ClampedArray _U8C_2(arg1, arg2) =>
+      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #)', arg1, arg2);
 
-  static Float32Array _F32_3(arg1, arg2, arg3) native 'return new Float32Array(arg1, arg2, arg3);';
-  static Float64Array _F64_3(arg1, arg2, arg3) native 'return new Float64Array(arg1, arg2, arg3);';
-  static Int8Array _I8_3(arg1, arg2, arg3) native 'return new Int8Array(arg1, arg2, arg3);';
-  static Int16Array _I16_3(arg1, arg2, arg3) native 'return new Int16Array(arg1, arg2, arg3);';
-  static Int32Array _I32_3(arg1, arg2, arg3) native 'return new Int32Array(arg1, arg2, arg3);';
-  static Uint8Array _U8_3(arg1, arg2, arg3) native 'return new Uint8Array(arg1, arg2, arg3);';
-  static Uint16Array _U16_3(arg1, arg2, arg3) native 'return new Uint16Array(arg1, arg2, arg3);';
-  static Uint32Array _U32_3(arg1, arg2, arg3) native 'return new Uint32Array(arg1, arg2, arg3);';
-  static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) native 'return new Uint8ClampedArray(arg1, arg2, arg3);';
+  static Float32Array _F32_3(arg1, arg2, arg3) =>
+      JS('Float32Array', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
+  static Float64Array _F64_3(arg1, arg2, arg3) =>
+      JS('Float64Array', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
+  static Int8Array _I8_3(arg1, arg2, arg3) =>
+      JS('Int8Array', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
+  static Int16Array _I16_3(arg1, arg2, arg3) =>
+      JS('Int16Array', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
+  static Int32Array _I32_3(arg1, arg2, arg3) =>
+      JS('Int32Array', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8Array _U8_3(arg1, arg2, arg3) =>
+      JS('Uint8Array', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
+  static Uint16Array _U16_3(arg1, arg2, arg3) =>
+      JS('Uint16Array', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
+  static Uint32Array _U32_3(arg1, arg2, arg3) =>
+      JS('Uint32Array', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) =>
+      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
 
 
   // Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
diff --git a/lib/html/dartium/html_dartium.dart b/lib/html/dartium/html_dartium.dart
index 6535ef4..c1e51fe 100644
--- a/lib/html/dartium/html_dartium.dart
+++ b/lib/html/dartium/html_dartium.dart
@@ -122,7 +122,7 @@
 /// @domName HTMLAnchorElement
 abstract class AnchorElement implements Element {
 
-  factory AnchorElement([String href]) {
+  factory AnchorElement({String href}) {
     if (!?href) {
       return _Elements.createAnchorElement();
     }
@@ -198,7 +198,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLAnchorElementImpl extends _HTMLElementImpl implements AnchorElement {
+class _AnchorElementImpl extends _ElementImpl_Merged implements AnchorElement {
 
   String get charset native "HTMLAnchorElement_charset_Getter";
 
@@ -356,7 +356,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitAnimationEventImpl extends _EventImpl implements AnimationEvent {
+class _AnimationEventImpl extends _EventImpl implements AnimationEvent {
 
   String get animationName native "WebKitAnimationEvent_animationName_Getter";
 
@@ -369,7 +369,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitAnimationImpl extends NativeFieldWrapperClass1 implements Animation {
+class _AnimationImpl extends NativeFieldWrapperClass1 implements Animation {
 
   num get delay native "WebKitAnimation_delay_Getter";
 
@@ -444,7 +444,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLAppletElementImpl extends _HTMLElementImpl implements AppletElement {
+class _AppletElementImpl extends _ElementImpl_Merged implements AppletElement {
 
   String get align native "HTMLAppletElement_align_Getter";
 
@@ -550,7 +550,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLAreaElementImpl extends _HTMLElementImpl implements AreaElement {
+class _AreaElementImpl extends _ElementImpl_Merged implements AreaElement {
 
   String get alt native "HTMLAreaElement_alt_Getter";
 
@@ -622,7 +622,7 @@
 
   int get byteLength native "ArrayBuffer_byteLength_Getter";
 
-  ArrayBuffer slice(begin, [end]) {
+  ArrayBuffer slice(/*long*/ begin, [/*long*/ end]) {
     if (?end) {
       return _slice_1(begin, end);
     }
@@ -745,7 +745,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool AudioBufferCallback(AudioBuffer audioBuffer);
+typedef void AudioBufferCallback(AudioBuffer audioBuffer);
 // Copyright (c) 2012, 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.
@@ -836,7 +836,7 @@
 
   int get playbackState native "AudioBufferSourceNode_playbackState_Getter";
 
-  void start(when, [grainOffset, grainDuration]) {
+  void start(/*double*/ when, [/*double*/ grainOffset, /*double*/ grainDuration]) {
     if ((when is num || when === null) && !?grainOffset && !?grainDuration) {
       _start_1(when);
       return;
@@ -1008,7 +1008,7 @@
 
   BiquadFilterNode createBiquadFilter() native "AudioContext_createBiquadFilter_Callback";
 
-  AudioBuffer createBuffer(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFrames, [sampleRate]) {
+  AudioBuffer createBuffer(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFrames, [/*float*/ sampleRate]) {
     if ((buffer_OR_numberOfChannels is int || buffer_OR_numberOfChannels === null) && (mixToMono_OR_numberOfFrames is int || mixToMono_OR_numberOfFrames === null) && (sampleRate is num || sampleRate === null)) {
       return _createBuffer_1(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFrames, sampleRate);
     }
@@ -1024,7 +1024,7 @@
 
   AudioBufferSourceNode createBufferSource() native "AudioContext_createBufferSource_Callback";
 
-  AudioChannelMerger createChannelMerger([numberOfInputs]) {
+  AudioChannelMerger createChannelMerger([/*unsigned long*/ numberOfInputs]) {
     if (?numberOfInputs) {
       return _createChannelMerger_1(numberOfInputs);
     }
@@ -1035,7 +1035,7 @@
 
   AudioChannelMerger _createChannelMerger_2() native "AudioContext_createChannelMerger_2_Callback";
 
-  AudioChannelSplitter createChannelSplitter([numberOfOutputs]) {
+  AudioChannelSplitter createChannelSplitter([/*unsigned long*/ numberOfOutputs]) {
     if (?numberOfOutputs) {
       return _createChannelSplitter_1(numberOfOutputs);
     }
@@ -1048,7 +1048,7 @@
 
   ConvolverNode createConvolver() native "AudioContext_createConvolver_Callback";
 
-  DelayNode createDelayNode([maxDelayTime]) {
+  DelayNode createDelayNode([/*double*/ maxDelayTime]) {
     if (?maxDelayTime) {
       return _createDelayNode_1(maxDelayTime);
     }
@@ -1063,7 +1063,7 @@
 
   AudioGainNode createGainNode() native "AudioContext_createGainNode_Callback";
 
-  JavaScriptAudioNode createJavaScriptNode(bufferSize, [numberOfInputChannels, numberOfOutputChannels]) {
+  JavaScriptAudioNode createJavaScriptNode(/*unsigned long*/ bufferSize, [/*unsigned long*/ numberOfInputChannels, /*unsigned long*/ numberOfOutputChannels]) {
     if (?numberOfOutputChannels) {
       return _createJavaScriptNode_1(bufferSize, numberOfInputChannels, numberOfOutputChannels);
     }
@@ -1147,7 +1147,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLAudioElementImpl extends _HTMLMediaElementImpl implements AudioElement {
+class _AudioElementImpl extends _MediaElementImpl implements AudioElement {
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -1276,7 +1276,7 @@
 
   int get numberOfOutputs native "AudioNode_numberOfOutputs_Getter";
 
-  void connect(destination, output, [input]) {
+  void connect(destination, /*unsigned long*/ output, [/*unsigned long*/ input]) {
     if ((destination is AudioNode || destination === null) && (output is int || output === null) && (input is int || input === null)) {
       _connect_1(destination, output, input);
       return;
@@ -1552,7 +1552,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLBRElementImpl extends _HTMLElementImpl implements BRElement {
+class _BRElementImpl extends _ElementImpl_Merged implements BRElement {
 
   String get clear native "HTMLBRElement_clear_Getter";
 
@@ -1605,7 +1605,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLBaseElementImpl extends _HTMLElementImpl implements BaseElement {
+class _BaseElementImpl extends _ElementImpl_Merged implements BaseElement {
 
   String get href native "HTMLBaseElement_href_Getter";
 
@@ -1640,7 +1640,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLBaseFontElementImpl extends _HTMLElementImpl implements BaseFontElement {
+class _BaseFontElementImpl extends _ElementImpl_Merged implements BaseFontElement {
 
   String get color native "HTMLBaseFontElement_color_Getter";
 
@@ -1863,7 +1863,7 @@
 
   String get type native "Blob_type_Getter";
 
-  Blob slice([start, end, contentType]) {
+  Blob slice([/*long long*/ start, /*long long*/ end, /*DOMString*/ contentType]) {
     if (?contentType) {
       return _slice_1(start, end, contentType);
     }
@@ -1951,7 +1951,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLBodyElementImpl extends _HTMLElementImpl implements BodyElement {
+class _BodyElementImpl extends _ElementImpl_Merged implements BodyElement {
 
   _BodyElementEventsImpl get on =>
     new _BodyElementEventsImpl(this);
@@ -2075,7 +2075,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLButtonElementImpl extends _HTMLElementImpl implements ButtonElement {
+class _ButtonElementImpl extends _ElementImpl_Merged implements ButtonElement {
 
   bool get autofocus native "HTMLButtonElement_autofocus_Getter";
 
@@ -2252,7 +2252,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitCSSKeyframeRuleImpl extends _CSSRuleImpl implements CSSKeyframeRule {
+class _CSSKeyframeRuleImpl extends _CSSRuleImpl implements CSSKeyframeRule {
 
   String get keyText native "WebKitCSSKeyframeRule_keyText_Getter";
 
@@ -2291,7 +2291,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitCSSKeyframesRuleImpl extends _CSSRuleImpl implements CSSKeyframesRule {
+class _CSSKeyframesRuleImpl extends _CSSRuleImpl implements CSSKeyframesRule {
 
   List<CSSRule> get cssRules native "WebKitCSSKeyframesRule_cssRules_Getter";
 
@@ -2424,7 +2424,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitCSSMatrixImpl extends NativeFieldWrapperClass1 implements CSSMatrix {
+class _CSSMatrixImpl extends NativeFieldWrapperClass1 implements CSSMatrix {
 
   num get a native "WebKitCSSMatrix_a_Getter";
 
@@ -2818,6 +2818,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(CSSRule element) => _Collections.contains(this, element);
+
   void forEach(void f(CSSRule element)) => _Collections.forEach(this, f);
 
   Collection map(f(CSSRule element)) => _Collections.map(this, [], f);
@@ -2833,7 +2835,7 @@
 
   // From List<CSSRule>:
 
-  void sort(int compare(CSSRule a, CSSRule b)) {
+  void sort([Comparator<CSSRule> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -7652,7 +7654,7 @@
 
   List<CSSRule> get rules native "CSSStyleSheet_rules_Getter";
 
-  int addRule(selector, style, [index]) {
+  int addRule(/*DOMString*/ selector, /*DOMString*/ style, [/*unsigned long*/ index]) {
     if (?index) {
       return _addRule_1(selector, style, index);
     }
@@ -7730,7 +7732,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitCSSTransformValueImpl extends _CSSValueListImpl implements CSSTransformValue {
+class _CSSTransformValueImpl extends _CSSValueListImpl implements CSSTransformValue {
 
   int get operationType native "WebKitCSSTransformValue_operationType_Getter";
 
@@ -7832,6 +7834,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(CSSValue element) => _Collections.contains(this, element);
+
   void forEach(void f(CSSValue element)) => _Collections.forEach(this, f);
 
   Collection map(f(CSSValue element)) => _Collections.map(this, [], f);
@@ -7847,7 +7851,7 @@
 
   // From List<CSSValue>:
 
-  void sort(int compare(CSSValue a, CSSValue b)) {
+  void sort([Comparator<CSSValue> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -7894,7 +7898,7 @@
 /// @domName HTMLCanvasElement
 abstract class CanvasElement implements Element {
 
-  factory CanvasElement([int width, int height]) {
+  factory CanvasElement({int width, int height}) {
     if (!?width) {
       return _Elements.createCanvasElement();
     }
@@ -7922,7 +7926,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.
 
-class _HTMLCanvasElementImpl extends _HTMLElementImpl implements CanvasElement {
+class _CanvasElementImpl extends _ElementImpl_Merged implements CanvasElement {
 
   int get height native "HTMLCanvasElement_height_Getter";
 
@@ -8328,7 +8332,7 @@
 
   void closePath() native "CanvasRenderingContext2D_closePath_Callback";
 
-  ImageData createImageData(imagedata_OR_sw, [sh]) {
+  ImageData createImageData(imagedata_OR_sw, [/*float*/ sh]) {
     if ((imagedata_OR_sw is ImageData || imagedata_OR_sw === null) && !?sh) {
       return _createImageData_1(imagedata_OR_sw);
     }
@@ -8344,7 +8348,7 @@
 
   CanvasGradient createLinearGradient(num x0, num y0, num x1, num y1) native "CanvasRenderingContext2D_createLinearGradient_Callback";
 
-  CanvasPattern createPattern(canvas_OR_image, repetitionType) {
+  CanvasPattern createPattern(canvas_OR_image, /*DOMString*/ repetitionType) {
     if ((canvas_OR_image is CanvasElement || canvas_OR_image === null) && (repetitionType is String || repetitionType === null)) {
       return _createPattern_1(canvas_OR_image, repetitionType);
     }
@@ -8360,7 +8364,7 @@
 
   CanvasGradient createRadialGradient(num x0, num y0, num r0, num x1, num y1, num r1) native "CanvasRenderingContext2D_createRadialGradient_Callback";
 
-  void drawImage(canvas_OR_image_OR_video, sx_OR_x, sy_OR_y, [sw_OR_width, height_OR_sh, dx, dy, dw, dh]) {
+  void drawImage(canvas_OR_image_OR_video, /*float*/ sx_OR_x, /*float*/ sy_OR_y, [/*float*/ sw_OR_width, /*float*/ height_OR_sh, /*float*/ dx, /*float*/ dy, /*float*/ dw, /*float*/ dh]) {
     if ((canvas_OR_image_OR_video is ImageElement || canvas_OR_image_OR_video === null) && (sx_OR_x is num || sx_OR_x === null) && (sy_OR_y is num || sy_OR_y === null) && !?sw_OR_width && !?height_OR_sh && !?dx && !?dy && !?dw && !?dh) {
       _drawImage_1(canvas_OR_image_OR_video, sx_OR_x, sy_OR_y);
       return;
@@ -8418,7 +8422,7 @@
 
   void _drawImage_9(canvas_OR_image_OR_video, sx_OR_x, sy_OR_y, sw_OR_width, height_OR_sh, dx, dy, dw, dh) native "CanvasRenderingContext2D_drawImage_9_Callback";
 
-  void drawImageFromRect(image, [sx, sy, sw, sh, dx, dy, dw, dh, compositeOperation]) {
+  void drawImageFromRect(/*HTMLImageElement*/ image, [/*float*/ sx, /*float*/ sy, /*float*/ sw, /*float*/ sh, /*float*/ dx, /*float*/ dy, /*float*/ dw, /*float*/ dh, /*DOMString*/ compositeOperation]) {
     if (?compositeOperation) {
       _drawImageFromRect_1(image, sx, sy, sw, sh, dx, dy, dw, dh, compositeOperation);
       return;
@@ -8482,7 +8486,7 @@
 
   void fillRect(num x, num y, num width, num height) native "CanvasRenderingContext2D_fillRect_Callback";
 
-  void fillText(text, x, y, [maxWidth]) {
+  void fillText(/*DOMString*/ text, /*float*/ x, /*float*/ y, [/*float*/ maxWidth]) {
     if (?maxWidth) {
       _fillText_1(text, x, y, maxWidth);
       return;
@@ -8506,7 +8510,7 @@
 
   void moveTo(num x, num y) native "CanvasRenderingContext2D_moveTo_Callback";
 
-  void putImageData(imagedata, dx, dy, [dirtyX, dirtyY, dirtyWidth, dirtyHeight]) {
+  void putImageData(/*ImageData*/ imagedata, /*float*/ dx, /*float*/ dy, [/*float*/ dirtyX, /*float*/ dirtyY, /*float*/ dirtyWidth, /*float*/ dirtyHeight]) {
     if ((imagedata is ImageData || imagedata === null) && (dx is num || dx === null) && (dy is num || dy === null) && !?dirtyX && !?dirtyY && !?dirtyWidth && !?dirtyHeight) {
       _putImageData_1(imagedata, dx, dy);
       return;
@@ -8548,7 +8552,7 @@
 
   void setMiterLimit(num limit) native "CanvasRenderingContext2D_setMiterLimit_Callback";
 
-  void setShadow(width, height, blur, [c_OR_color_OR_grayLevel_OR_r, alpha_OR_g_OR_m, b_OR_y, a_OR_k, a]) {
+  void setShadow(/*float*/ width, /*float*/ height, /*float*/ blur, [c_OR_color_OR_grayLevel_OR_r, /*float*/ alpha_OR_g_OR_m, /*float*/ b_OR_y, /*float*/ a_OR_k, /*float*/ a]) {
     if ((width is num || width === null) && (height is num || height === null) && (blur is num || blur === null) && !?c_OR_color_OR_grayLevel_OR_r && !?alpha_OR_g_OR_m && !?b_OR_y && !?a_OR_k && !?a) {
       _setShadow_1(width, height, blur);
       return;
@@ -8598,7 +8602,7 @@
 
   void stroke() native "CanvasRenderingContext2D_stroke_Callback";
 
-  void strokeRect(x, y, width, height, [lineWidth]) {
+  void strokeRect(/*float*/ x, /*float*/ y, /*float*/ width, /*float*/ height, [/*float*/ lineWidth]) {
     if (?lineWidth) {
       _strokeRect_1(x, y, width, height, lineWidth);
       return;
@@ -8610,7 +8614,7 @@
 
   void _strokeRect_2(x, y, width, height) native "CanvasRenderingContext2D_strokeRect_2_Callback";
 
-  void strokeText(text, x, y, [maxWidth]) {
+  void strokeText(/*DOMString*/ text, /*float*/ x, /*float*/ y, [/*float*/ maxWidth]) {
     if (?maxWidth) {
       _strokeText_1(text, x, y, maxWidth);
       return;
@@ -8628,7 +8632,7 @@
 
   ImageData webkitGetImageDataHD(num sx, num sy, num sw, num sh) native "CanvasRenderingContext2D_webkitGetImageDataHD_Callback";
 
-  void webkitPutImageDataHD(imagedata, dx, dy, [dirtyX, dirtyY, dirtyWidth, dirtyHeight]) {
+  void webkitPutImageDataHD(/*ImageData*/ imagedata, /*float*/ dx, /*float*/ dy, [/*float*/ dirtyX, /*float*/ dirtyY, /*float*/ dirtyWidth, /*float*/ dirtyHeight]) {
     if ((imagedata is ImageData || imagedata === null) && (dx is num || dx === null) && (dy is num || dy === null) && !?dirtyX && !?dirtyY && !?dirtyWidth && !?dirtyHeight) {
       _webkitPutImageDataHD_1(imagedata, dx, dy);
       return;
@@ -8821,6 +8825,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(ClientRect element) => _Collections.contains(this, element);
+
   void forEach(void f(ClientRect element)) => _Collections.forEach(this, f);
 
   Collection map(f(ClientRect element)) => _Collections.map(this, [], f);
@@ -8836,7 +8842,7 @@
 
   // From List<ClientRect>:
 
-  void sort(int compare(ClientRect a, ClientRect b)) {
+  void sort([Comparator<ClientRect> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -9163,7 +9169,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLContentElementImpl extends _HTMLElementImpl implements ContentElement {
+class _ContentElementImpl extends _ElementImpl_Merged implements ContentElement {
 
   String get select native "HTMLContentElement_select_Getter";
 
@@ -9364,7 +9370,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLDListElementImpl extends _HTMLElementImpl implements DListElement {
+class _DListElementImpl extends _ElementImpl_Merged implements DListElement {
 
   bool get compact native "HTMLDListElement_compact_Getter";
 
@@ -9583,7 +9589,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _DOMCoreExceptionImpl extends NativeFieldWrapperClass1 implements DOMException {
+class _DOMExceptionImpl extends NativeFieldWrapperClass1 implements DOMException {
 
   int get code native "DOMCoreException_code_Getter";
 
@@ -9773,6 +9779,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(DOMMimeType element) => _Collections.contains(this, element);
+
   void forEach(void f(DOMMimeType element)) => _Collections.forEach(this, f);
 
   Collection map(f(DOMMimeType element)) => _Collections.map(this, [], f);
@@ -9788,7 +9796,7 @@
 
   // From List<DOMMimeType>:
 
-  void sort(int compare(DOMMimeType a, DOMMimeType b)) {
+  void sort([Comparator<DOMMimeType> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -9959,6 +9967,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(DOMPlugin element) => _Collections.contains(this, element);
+
   void forEach(void f(DOMPlugin element)) => _Collections.forEach(this, f);
 
   Collection map(f(DOMPlugin element)) => _Collections.map(this, [], f);
@@ -9974,7 +9984,7 @@
 
   // From List<DOMPlugin>:
 
-  void sort(int compare(DOMPlugin a, DOMPlugin b)) {
+  void sort([Comparator<DOMPlugin> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -10216,25 +10226,7 @@
 
 // WARNING: Do not edit - generated code.
 
-/// @domName DOMStringList
-abstract class DOMStringList implements List<String> {
-
-  /** @domName DOMStringList.length */
-  abstract int get length;
-
-  /** @domName DOMStringList.contains */
-  bool contains(String string);
-
-  /** @domName DOMStringList.item */
-  String item(int index);
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-class _DOMStringListImpl extends NativeFieldWrapperClass1 implements DOMStringList {
+class _DOMStringListImpl extends NativeFieldWrapperClass1 implements List<String> {
 
   int get length native "DOMStringList_length_Getter";
 
@@ -10269,6 +10261,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  // contains() defined by IDL.
+
   void forEach(void f(String element)) => _Collections.forEach(this, f);
 
   Collection map(f(String element)) => _Collections.map(this, [], f);
@@ -10284,7 +10278,7 @@
 
   // From List<String>:
 
-  void sort(int compare(String a, String b)) {
+  void sort([Comparator<String> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -10443,7 +10437,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLDataListElementImpl extends _HTMLElementImpl implements DataListElement {
+class _DataListElementImpl extends _ElementImpl_Merged implements DataListElement {
 
   HTMLCollection get options native "HTMLDataListElement_options_Getter";
 
@@ -10522,7 +10516,7 @@
 
   int get length native "DataTransferItemList_length_Getter";
 
-  void add(data_OR_file, [type]) {
+  void add(data_OR_file, [/*DOMString*/ type]) {
     if ((data_OR_file is File || data_OR_file === null) && !?type) {
       _add_1(data_OR_file);
       return;
@@ -10618,7 +10612,7 @@
 
 class _DataViewImpl extends _ArrayBufferViewImpl implements DataView {
 
-  num getFloat32(byteOffset, [littleEndian]) {
+  num getFloat32(/*unsigned long*/ byteOffset, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       return _getFloat32_1(byteOffset, littleEndian);
     }
@@ -10629,7 +10623,7 @@
 
   num _getFloat32_2(byteOffset) native "DataView_getFloat32_2_Callback";
 
-  num getFloat64(byteOffset, [littleEndian]) {
+  num getFloat64(/*unsigned long*/ byteOffset, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       return _getFloat64_1(byteOffset, littleEndian);
     }
@@ -10640,7 +10634,7 @@
 
   num _getFloat64_2(byteOffset) native "DataView_getFloat64_2_Callback";
 
-  int getInt16(byteOffset, [littleEndian]) {
+  int getInt16(/*unsigned long*/ byteOffset, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       return _getInt16_1(byteOffset, littleEndian);
     }
@@ -10651,7 +10645,7 @@
 
   int _getInt16_2(byteOffset) native "DataView_getInt16_2_Callback";
 
-  int getInt32(byteOffset, [littleEndian]) {
+  int getInt32(/*unsigned long*/ byteOffset, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       return _getInt32_1(byteOffset, littleEndian);
     }
@@ -10664,7 +10658,7 @@
 
   int getInt8(int byteOffset) native "DataView_getInt8_Callback";
 
-  int getUint16(byteOffset, [littleEndian]) {
+  int getUint16(/*unsigned long*/ byteOffset, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       return _getUint16_1(byteOffset, littleEndian);
     }
@@ -10675,7 +10669,7 @@
 
   int _getUint16_2(byteOffset) native "DataView_getUint16_2_Callback";
 
-  int getUint32(byteOffset, [littleEndian]) {
+  int getUint32(/*unsigned long*/ byteOffset, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       return _getUint32_1(byteOffset, littleEndian);
     }
@@ -10688,7 +10682,7 @@
 
   int getUint8(int byteOffset) native "DataView_getUint8_Callback";
 
-  void setFloat32(byteOffset, value, [littleEndian]) {
+  void setFloat32(/*unsigned long*/ byteOffset, /*float*/ value, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       _setFloat32_1(byteOffset, value, littleEndian);
       return;
@@ -10700,7 +10694,7 @@
 
   void _setFloat32_2(byteOffset, value) native "DataView_setFloat32_2_Callback";
 
-  void setFloat64(byteOffset, value, [littleEndian]) {
+  void setFloat64(/*unsigned long*/ byteOffset, /*double*/ value, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       _setFloat64_1(byteOffset, value, littleEndian);
       return;
@@ -10712,7 +10706,7 @@
 
   void _setFloat64_2(byteOffset, value) native "DataView_setFloat64_2_Callback";
 
-  void setInt16(byteOffset, value, [littleEndian]) {
+  void setInt16(/*unsigned long*/ byteOffset, /*short*/ value, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       _setInt16_1(byteOffset, value, littleEndian);
       return;
@@ -10724,7 +10718,7 @@
 
   void _setInt16_2(byteOffset, value) native "DataView_setInt16_2_Callback";
 
-  void setInt32(byteOffset, value, [littleEndian]) {
+  void setInt32(/*unsigned long*/ byteOffset, /*long*/ value, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       _setInt32_1(byteOffset, value, littleEndian);
       return;
@@ -10738,7 +10732,7 @@
 
   void setInt8(int byteOffset, int value) native "DataView_setInt8_Callback";
 
-  void setUint16(byteOffset, value, [littleEndian]) {
+  void setUint16(/*unsigned long*/ byteOffset, /*unsigned short*/ value, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       _setUint16_1(byteOffset, value, littleEndian);
       return;
@@ -10750,7 +10744,7 @@
 
   void _setUint16_2(byteOffset, value) native "DataView_setUint16_2_Callback";
 
-  void setUint32(byteOffset, value, [littleEndian]) {
+  void setUint32(/*unsigned long*/ byteOffset, /*unsigned long*/ value, [/*boolean*/ littleEndian]) {
     if (?littleEndian) {
       _setUint32_1(byteOffset, value, littleEndian);
       return;
@@ -10792,7 +10786,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool DatabaseCallback(database);
+typedef void DatabaseCallback(database);
 // Copyright (c) 2012, 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.
@@ -10938,7 +10932,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLDetailsElementImpl extends _HTMLElementImpl implements DetailsElement {
+class _DetailsElementImpl extends _ElementImpl_Merged implements DetailsElement {
 
   bool get open native "HTMLDetailsElement_open_Getter";
 
@@ -11029,7 +11023,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLDirectoryElementImpl extends _HTMLElementImpl implements DirectoryElement {
+class _DirectoryElementImpl extends _ElementImpl_Merged implements DirectoryElement {
 
   bool get compact native "HTMLDirectoryElement_compact_Getter";
 
@@ -11067,7 +11061,7 @@
 
   DirectoryReader createReader() native "DirectoryEntry_createReader_Callback";
 
-  void getDirectory(path, [options, successCallback, errorCallback]) {
+  void getDirectory(/*DOMString*/ path, [/*Dictionary*/ options, /*EntryCallback*/ successCallback, /*ErrorCallback*/ errorCallback]) {
     if (?options) {
       _getDirectory_1(path, options, successCallback, errorCallback);
       return;
@@ -11079,7 +11073,7 @@
 
   void _getDirectory_2(path) native "DirectoryEntry_getDirectory_2_Callback";
 
-  void getFile(path, [options, successCallback, errorCallback]) {
+  void getFile(/*DOMString*/ path, [/*Dictionary*/ options, /*EntryCallback*/ successCallback, /*ErrorCallback*/ errorCallback]) {
     if (?options) {
       _getFile_1(path, options, successCallback, errorCallback);
       return;
@@ -11198,7 +11192,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLDivElementImpl extends _HTMLElementImpl implements DivElement {
+class _DivElementImpl extends _ElementImpl_Merged implements DivElement {
 
   String get align native "HTMLDivElement_align_Getter";
 
@@ -11555,7 +11549,11 @@
     add(value);
   }
 
-  void sort(int compare(Element a, Element b)) {
+  bool contains(Element element) {
+    return element is Element && _childNodes.contains(element);
+  }
+
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('TODO(jacobr): should we impl?');
   }
 
@@ -11992,7 +11990,7 @@
 
   void webkitExitPointerLock() native "Document_webkitExitPointerLock_Callback";
 
-  // TODO(jacobr): implement all Element methods not on Document. 
+  // TODO(jacobr): implement all Element methods not on Document.
 
   _ElementImpl query(String selectors) {
     // It is fine for our RegExp to detect element id query selectors to have
@@ -12134,7 +12132,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLDocumentImpl extends _DocumentImpl implements Document {
+class _DocumentImpl_Merged extends _DocumentImpl implements Document {
 
   Element get activeElement native "HTMLDocument_activeElement_Getter";
 
@@ -12690,6 +12688,8 @@
     return output;
   }
 
+  bool contains(Element element) => _childElements.contains(element);
+
   void forEach(void f(Element element)) {
     for (_ElementImpl element in _childElements) {
       f(element);
@@ -12707,7 +12707,7 @@
   }
 
   bool every(bool f(Element element)) {
-    for(Element element in this) {
+    for (Element element in this) {
       if (!f(element)) {
         return false;
       }
@@ -12716,7 +12716,7 @@
   }
 
   bool some(bool f(Element element)) {
-    for(Element element in this) {
+    for (Element element in this) {
       if (f(element)) {
         return true;
       }
@@ -12768,7 +12768,7 @@
     }
   }
 
-  void sort(int compare(Element a, Element b)) {
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('TODO(jacobr): should we impl?');
   }
 
@@ -12828,6 +12828,13 @@
     return _nodeList[0];
   }
 
+  bool contains(Element element) {
+    for (Element el in this) {
+      if (el == element) return true;
+    }
+    return false;
+  }
+
   void forEach(void f(Element element)) {
     for (Element el in this) {
       f(el);
@@ -12896,7 +12903,7 @@
     throw const UnsupportedOperationException('');
   }
 
-  void sort(int compare(Element a, Element b)) {
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('');
   }
 
@@ -13488,7 +13495,7 @@
 
   void scrollByPages(int pages) native "Element_scrollByPages_Callback";
 
-  void scrollIntoView([centerIfNeeded]) {
+  void scrollIntoView([/*boolean*/ centerIfNeeded]) {
     if (?centerIfNeeded) {
       _scrollIntoViewIfNeeded_1(centerIfNeeded);
       return;
@@ -13677,7 +13684,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLElementImpl extends _ElementImpl implements Element {
+class _ElementImpl_Merged extends _ElementImpl implements Element {
 
   HTMLCollection get $dom_children native "HTMLElement_children_Getter";
 
@@ -13822,7 +13829,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLEmbedElementImpl extends _HTMLElementImpl implements EmbedElement {
+class _EmbedElementImpl extends _ElementImpl_Merged implements EmbedElement {
 
   String get align native "HTMLEmbedElement_align_Getter";
 
@@ -13855,39 +13862,6 @@
 
 // WARNING: Do not edit - generated code.
 
-/// @domName Entity
-abstract class Entity implements Node {
-
-  /** @domName Entity.notationName */
-  abstract String get notationName;
-
-  /** @domName Entity.publicId */
-  abstract String get publicId;
-
-  /** @domName Entity.systemId */
-  abstract String get systemId;
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
-class _EntityImpl extends _NodeImpl implements Entity {
-
-  String get notationName native "Entity_notationName_Getter";
-
-  String get publicId native "Entity_publicId_Getter";
-
-  String get systemId native "Entity_systemId_Getter";
-
-}
-// Copyright (c) 2012, 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.
-
-// WARNING: Do not edit - generated code.
-
 /// @domName EntityReference
 abstract class EntityReference implements Node {
 }
@@ -13906,7 +13880,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool EntriesCallback(List<Entry> entries);
+typedef void EntriesCallback(List<Entry> entries);
 // Copyright (c) 2012, 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.
@@ -13990,6 +13964,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Entry element) => _Collections.contains(this, element);
+
   void forEach(void f(Entry element)) => _Collections.forEach(this, f);
 
   Collection map(f(Entry element)) => _Collections.map(this, [], f);
@@ -14005,7 +13981,7 @@
 
   // From List<Entry>:
 
-  void sort(int compare(Entry a, Entry b)) {
+  void sort([Comparator<Entry> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14084,6 +14060,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(EntrySync element) => _Collections.contains(this, element);
+
   void forEach(void f(EntrySync element)) => _Collections.forEach(this, f);
 
   Collection map(f(EntrySync element)) => _Collections.map(this, [], f);
@@ -14099,7 +14077,7 @@
 
   // From List<EntrySync>:
 
-  void sort(int compare(EntrySync a, EntrySync b)) {
+  void sort([Comparator<EntrySync> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -14143,7 +14121,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool EntryCallback(Entry entry);
+typedef void EntryCallback(Entry entry);
 // Copyright (c) 2012, 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.
@@ -14162,7 +14140,7 @@
 
   String get name native "Entry_name_Getter";
 
-  void copyTo(parent, [name, successCallback, errorCallback]) {
+  void copyTo(/*DirectoryEntry*/ parent, [/*DOMString*/ name, /*EntryCallback*/ successCallback, /*ErrorCallback*/ errorCallback]) {
     if (?name) {
       _copyTo_1(parent, name, successCallback, errorCallback);
       return;
@@ -14178,7 +14156,7 @@
 
   void getParent([EntryCallback successCallback, ErrorCallback errorCallback]) native "Entry_getParent_Callback";
 
-  void moveTo(parent, [name, successCallback, errorCallback]) {
+  void moveTo(/*DirectoryEntry*/ parent, [/*DOMString*/ name, /*EntryCallback*/ successCallback, /*ErrorCallback*/ errorCallback]) {
     if (?name) {
       _moveTo_1(parent, name, successCallback, errorCallback);
       return;
@@ -14274,7 +14252,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool ErrorCallback(FileError error);
+typedef void ErrorCallback(FileError error);
 // Copyright (c) 2012, 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.
@@ -14734,7 +14712,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLFieldSetElementImpl extends _HTMLElementImpl implements FieldSetElement {
+class _FieldSetElementImpl extends _ElementImpl_Merged implements FieldSetElement {
 
   bool get disabled native "HTMLFieldSetElement_disabled_Getter";
 
@@ -14785,7 +14763,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool FileCallback(File file);
+typedef void FileCallback(File file);
 // Copyright (c) 2012, 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.
@@ -15007,6 +14985,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(File element) => _Collections.contains(this, element);
+
   void forEach(void f(File element)) => _Collections.forEach(this, f);
 
   Collection map(f(File element)) => _Collections.map(this, [], f);
@@ -15022,7 +15002,7 @@
 
   // From List<File>:
 
-  void sort(int compare(File a, File b)) {
+  void sort([Comparator<File> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -15159,7 +15139,7 @@
 
   void readAsDataURL(Blob blob) native "FileReader_readAsDataURL_Callback";
 
-  void readAsText(blob, [encoding]) {
+  void readAsText(/*Blob*/ blob, [/*DOMString*/ encoding]) {
     if (?encoding) {
       _readAsText_1(blob, encoding);
       return;
@@ -15227,7 +15207,7 @@
 
   String readAsDataURL(Blob blob) native "FileReaderSync_readAsDataURL_Callback";
 
-  String readAsText(blob, [encoding]) {
+  String readAsText(/*Blob*/ blob, [/*DOMString*/ encoding]) {
     if (?encoding) {
       return _readAsText_1(blob, encoding);
     }
@@ -15245,7 +15225,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool FileSystemCallback(DOMFileSystem fileSystem);
+typedef void FileSystemCallback(DOMFileSystem fileSystem);
 // Copyright (c) 2012, 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.
@@ -15320,7 +15300,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool FileWriterCallback(FileWriter fileWriter);
+typedef void FileWriterCallback(FileWriter fileWriter);
 // Copyright (c) 2012, 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.
@@ -15482,6 +15462,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(num element) => _Collections.contains(this, element);
+
   void forEach(void f(num element)) => _Collections.forEach(this, f);
 
   Collection map(f(num element)) => _Collections.map(this, [], f);
@@ -15497,7 +15479,7 @@
 
   // From List<num>:
 
-  void sort(int compare(num a, num b)) {
+  void sort([Comparator<num> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -15534,7 +15516,7 @@
 
   void setElements(Object array, [int offset]) native "Float32Array_setElements_Callback";
 
-  Float32Array subarray(start, [end]) {
+  Float32Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -15614,6 +15596,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(num element) => _Collections.contains(this, element);
+
   void forEach(void f(num element)) => _Collections.forEach(this, f);
 
   Collection map(f(num element)) => _Collections.map(this, [], f);
@@ -15629,7 +15613,7 @@
 
   // From List<num>:
 
-  void sort(int compare(num a, num b)) {
+  void sort([Comparator<num> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -15666,7 +15650,7 @@
 
   void setElements(Object array, [int offset]) native "Float64Array_setElements_Callback";
 
-  Float64Array subarray(start, [end]) {
+  Float64Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -15702,7 +15686,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLFontElementImpl extends _HTMLElementImpl implements FontElement {
+class _FontElementImpl extends _ElementImpl_Merged implements FontElement {
 
   String get color native "HTMLFontElement_color_Getter";
 
@@ -15742,7 +15726,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _DOMFormDataImpl extends NativeFieldWrapperClass1 implements FormData {
+class _FormDataImpl extends NativeFieldWrapperClass1 implements FormData {
 
   void append(String name, String value, String filename) native "DOMFormData_append_Callback";
 
@@ -15803,7 +15787,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLFormElementImpl extends _HTMLElementImpl implements FormElement {
+class _FormElementImpl extends _ElementImpl_Merged implements FormElement {
 
   String get acceptCharset native "HTMLFormElement_acceptCharset_Getter";
 
@@ -15907,7 +15891,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLFrameElementImpl extends _HTMLElementImpl implements FrameElement {
+class _FrameElementImpl extends _ElementImpl_Merged implements FrameElement {
 
   Window get contentWindow native "HTMLFrameElement_contentWindow_Getter";
 
@@ -16007,7 +15991,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLFrameSetElementImpl extends _HTMLElementImpl implements FrameSetElement {
+class _FrameSetElementImpl extends _ElementImpl_Merged implements FrameSetElement {
 
   _FrameSetElementEventsImpl get on =>
     new _FrameSetElementEventsImpl(this);
@@ -16135,6 +16119,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Gamepad element) => _Collections.contains(this, element);
+
   void forEach(void f(Gamepad element)) => _Collections.forEach(this, f);
 
   Collection map(f(Gamepad element)) => _Collections.map(this, [], f);
@@ -16150,7 +16136,7 @@
 
   // From List<Gamepad>:
 
-  void sort(int compare(Gamepad a, Gamepad b)) {
+  void sort([Comparator<Gamepad> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -16278,7 +16264,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLHRElementImpl extends _HTMLElementImpl implements HRElement {
+class _HRElementImpl extends _ElementImpl_Merged implements HRElement {
 
   String get align native "HTMLHRElement_align_Getter";
 
@@ -16359,6 +16345,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -16374,7 +16362,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -16475,6 +16463,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -16490,7 +16480,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -16622,7 +16612,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLHeadElementImpl extends _HTMLElementImpl implements HeadElement {
+class _HeadElementImpl extends _ElementImpl_Merged implements HeadElement {
 
   String get profile native "HTMLHeadElement_profile_Getter";
 
@@ -16659,7 +16649,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLHeadingElementImpl extends _HTMLElementImpl implements HeadingElement {
+class _HeadingElementImpl extends _ElementImpl_Merged implements HeadingElement {
 
   String get align native "HTMLHeadingElement_align_Getter";
 
@@ -16683,7 +16673,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLHtmlElementImpl extends _HTMLElementImpl implements HtmlElement {
+class _HtmlElementImpl extends _ElementImpl_Merged implements HtmlElement {
 
 }
 // Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
@@ -16822,7 +16812,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _XMLHttpRequestExceptionImpl extends NativeFieldWrapperClass1 implements HttpRequestException {
+class _HttpRequestExceptionImpl extends NativeFieldWrapperClass1 implements HttpRequestException {
 
   int get code native "XMLHttpRequestException_code_Getter";
 
@@ -16839,7 +16829,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _XMLHttpRequestImpl extends _EventTargetImpl implements HttpRequest {
+class _HttpRequestImpl extends _EventTargetImpl implements HttpRequest {
 
   _HttpRequestEventsImpl get on =>
     new _HttpRequestEventsImpl(this);
@@ -16926,7 +16916,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _XMLHttpRequestProgressEventImpl extends _ProgressEventImpl implements HttpRequestProgressEvent {
+class _HttpRequestProgressEventImpl extends _ProgressEventImpl implements HttpRequestProgressEvent {
 
   int get position native "XMLHttpRequestProgressEvent_position_Getter";
 
@@ -16977,7 +16967,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _XMLHttpRequestUploadImpl extends _EventTargetImpl implements HttpRequestUpload {
+class _HttpRequestUploadImpl extends _EventTargetImpl implements HttpRequestUpload {
 
   _HttpRequestUploadEventsImpl get on =>
     new _HttpRequestUploadEventsImpl(this);
@@ -17082,7 +17072,7 @@
 
   void advance(int count) native "IDBCursor_advance_Callback";
 
-  void continueFunction([key]) {
+  void continueFunction([/*IDBKey*/ key]) {
     if (?key) {
       _continue_1(key);
       return;
@@ -17263,7 +17253,7 @@
 
   void close() native "IDBDatabase_close_Callback";
 
-  IDBObjectStore createObjectStore(name, [options]) {
+  IDBObjectStore createObjectStore(/*DOMString*/ name, [/*Dictionary*/ options]) {
     if (?options) {
       return _createObjectStore_1(name, options);
     }
@@ -17282,7 +17272,7 @@
 
   IDBVersionChangeRequest setVersion(String version) native "IDBDatabase_setVersion_Callback";
 
-  IDBTransaction transaction(storeName_OR_storeNames, mode) {
+  IDBTransaction transaction(storeName_OR_storeNames, /*DOMString*/ mode) {
     if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames === null) && (mode is String || mode === null)) {
       return _transaction_1(storeName_OR_storeNames, mode);
     }
@@ -17341,11 +17331,11 @@
 
 class _IDBFactoryImpl extends NativeFieldWrapperClass1 implements IDBFactory {
 
-  int cmp(first, second) native "IDBFactory_cmp_Callback";
+  int cmp(/*IDBKey*/ first, /*IDBKey*/ second) native "IDBFactory_cmp_Callback";
 
   IDBVersionChangeRequest deleteDatabase(String name) native "IDBFactory_deleteDatabase_Callback";
 
-  IDBOpenDBRequest open(name, [version]) {
+  IDBOpenDBRequest open(/*DOMString*/ name, [/*unsigned long long*/ version]) {
     if (?version) {
       return _open_1(name, version);
     }
@@ -17656,7 +17646,7 @@
 
   bool get upperOpen native "IDBKeyRange_upperOpen_Getter";
 
-  static IDBKeyRange bound_(lower, upper, [lowerOpen, upperOpen]) {
+  static IDBKeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [/*boolean*/ lowerOpen, /*boolean*/ upperOpen]) {
     if (?upperOpen) {
       return _bound_1(lower, upper, lowerOpen, upperOpen);
     }
@@ -17672,7 +17662,7 @@
 
   static IDBKeyRange _bound_3(lower, upper) native "IDBKeyRange_bound_3_Callback";
 
-  static IDBKeyRange lowerBound_(bound, [open]) {
+  static IDBKeyRange lowerBound_(/*IDBKey*/ bound, [/*boolean*/ open]) {
     if (?open) {
       return _lowerBound_1(bound, open);
     }
@@ -17683,9 +17673,9 @@
 
   static IDBKeyRange _lowerBound_2(bound) native "IDBKeyRange_lowerBound_2_Callback";
 
-  static IDBKeyRange only_(value) native "IDBKeyRange_only__Callback";
+  static IDBKeyRange only_(/*IDBKey*/ value) native "IDBKeyRange_only__Callback";
 
-  static IDBKeyRange upperBound_(bound, [open]) {
+  static IDBKeyRange upperBound_(/*IDBKey*/ bound, [/*boolean*/ open]) {
     if (?open) {
       return _upperBound_1(bound, open);
     }
@@ -17769,7 +17759,7 @@
 
   IDBTransaction get transaction native "IDBObjectStore_transaction_Getter";
 
-  IDBRequest add(value, [key]) {
+  IDBRequest add(/*any*/ value, [/*IDBKey*/ key]) {
     if (?key) {
       return _add_1(value, key);
     }
@@ -17801,7 +17791,7 @@
 
   IDBRequest _count_3(key_OR_range) native "IDBObjectStore_count_3_Callback";
 
-  IDBIndex createIndex(name, keyPath, [options]) {
+  IDBIndex createIndex(/*DOMString*/ name, keyPath, [/*Dictionary*/ options]) {
     if ((name is String || name === null) && (keyPath is List<String> || keyPath === null) && !?options) {
       return _createIndex_1(name, keyPath);
     }
@@ -17906,7 +17896,7 @@
 
   IDBRequest _openCursor_9(key_OR_range, direction) native "IDBObjectStore_openCursor_9_Callback";
 
-  IDBRequest put(value, [key]) {
+  IDBRequest put(/*any*/ value, [/*IDBKey*/ key]) {
     if (?key) {
       return _put_1(value, key);
     }
@@ -18300,7 +18290,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLIFrameElementImpl extends _HTMLElementImpl implements IFrameElement {
+class _IFrameElementImpl extends _ElementImpl_Merged implements IFrameElement {
 
   String get align native "HTMLIFrameElement_align_Getter";
 
@@ -18359,7 +18349,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool IceCallback(IceCandidate candidate, bool moreToFollow, PeerConnection00 source);
+typedef void IceCallback(IceCandidate candidate, bool moreToFollow, PeerConnection00 source);
 // Copyright (c) 2012, 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.
@@ -18432,7 +18422,7 @@
 /// @domName HTMLImageElement
 abstract class ImageElement implements Element {
 
-  factory ImageElement([String src, int width, int height]) {
+  factory ImageElement({String src, int width, int height}) {
     if (!?src) {
       return _Elements.createImageElement();
     }
@@ -18508,7 +18498,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLImageElementImpl extends _HTMLElementImpl implements ImageElement {
+class _ImageElementImpl extends _ElementImpl_Merged implements ImageElement {
 
   String get align native "HTMLImageElement_align_Getter";
 
@@ -18586,7 +18576,7 @@
 /// @domName HTMLInputElement
 abstract class InputElement implements Element {
 
-  factory InputElement([String type]) {
+  factory InputElement({String type}) {
     if (!?type) {
       return _Elements.createInputElement();
     }
@@ -18774,7 +18764,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLInputElementImpl extends _HTMLElementImpl implements InputElement {
+class _InputElementImpl extends _ElementImpl_Merged implements InputElement {
 
   _InputElementEventsImpl get on =>
     new _InputElementEventsImpl(this);
@@ -18969,7 +18959,7 @@
 
   void setSelectionRange(int start, int end, [String direction]) native "HTMLInputElement_setSelectionRange_Callback";
 
-  void stepDown([n]) {
+  void stepDown([/*long*/ n]) {
     if (?n) {
       _stepDown_1(n);
       return;
@@ -18981,7 +18971,7 @@
 
   void _stepDown_2() native "HTMLInputElement_stepDown_2_Callback";
 
-  void stepUp([n]) {
+  void stepUp([/*long*/ n]) {
     if (?n) {
       _stepUp_1(n);
       return;
@@ -19068,6 +19058,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -19083,7 +19075,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -19120,7 +19112,7 @@
 
   void setElements(Object array, [int offset]) native "Int16Array_setElements_Callback";
 
-  Int16Array subarray(start, [end]) {
+  Int16Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -19200,6 +19192,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -19215,7 +19209,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -19252,7 +19246,7 @@
 
   void setElements(Object array, [int offset]) native "Int32Array_setElements_Callback";
 
-  Int32Array subarray(start, [end]) {
+  Int32Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -19332,6 +19326,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -19347,7 +19343,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -19384,7 +19380,7 @@
 
   void setElements(Object array, [int offset]) native "Int8Array_setElements_Callback";
 
-  Int8Array subarray(start, [end]) {
+  Int8Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -19641,7 +19637,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLKeygenElementImpl extends _HTMLElementImpl implements KeygenElement {
+class _KeygenElementImpl extends _ElementImpl_Merged implements KeygenElement {
 
   bool get autofocus native "HTMLKeygenElement_autofocus_Getter";
 
@@ -19703,7 +19699,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLLIElementImpl extends _HTMLElementImpl implements LIElement {
+class _LIElementImpl extends _ElementImpl_Merged implements LIElement {
 
   String get type native "HTMLLIElement_type_Getter";
 
@@ -19740,7 +19736,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLLabelElementImpl extends _HTMLElementImpl implements LabelElement {
+class _LabelElementImpl extends _ElementImpl_Merged implements LabelElement {
 
   Element get control native "HTMLLabelElement_control_Getter";
 
@@ -19774,7 +19770,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLLegendElementImpl extends _HTMLElementImpl implements LegendElement {
+class _LegendElementImpl extends _ElementImpl_Merged implements LegendElement {
 
   String get align native "HTMLLegendElement_align_Getter";
 
@@ -19833,7 +19829,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLLinkElementImpl extends _HTMLElementImpl implements LinkElement {
+class _LinkElementImpl extends _ElementImpl_Merged implements LinkElement {
 
   String get charset native "HTMLLinkElement_charset_Getter";
 
@@ -19914,7 +19910,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HistoryImpl extends NativeFieldWrapperClass1 implements LocalHistory {
+class _LocalHistoryImpl extends NativeFieldWrapperClass1 implements LocalHistory {
 
   int get length native "History_length_Getter";
 
@@ -19988,7 +19984,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _LocationImpl extends NativeFieldWrapperClass1 implements LocalLocation {
+class _LocalLocationImpl extends NativeFieldWrapperClass1 implements LocalLocation {
 
   List<String> get ancestorOrigins native "Location_ancestorOrigins_Getter";
 
@@ -20537,7 +20533,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.
 
-class _DOMWindowImpl extends _EventTargetImpl implements LocalWindow {
+class _LocalWindowImpl extends _EventTargetImpl implements LocalWindow {
 
   void requestLayoutFrame(TimeoutHandler callback) {
     _addMeasurementFrameCallback(callback);
@@ -20713,7 +20709,7 @@
 
   Database openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) native "DOMWindow_openDatabase_Callback";
 
-  void postMessage(message, String targetOrigin, [List messagePorts]) native "DOMWindow_postMessage_Callback";
+  void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List messagePorts]) native "DOMWindow_postMessage_Callback";
 
   void print() native "DOMWindow_print_Callback";
 
@@ -20927,7 +20923,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLMapElementImpl extends _HTMLElementImpl implements MapElement {
+class _MapElementImpl extends _ElementImpl_Merged implements MapElement {
 
   HTMLCollection get areas native "HTMLMapElement_areas_Getter";
 
@@ -20990,7 +20986,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLMarqueeElementImpl extends _HTMLElementImpl implements MarqueeElement {
+class _MarqueeElementImpl extends _ElementImpl_Merged implements MarqueeElement {
 
   String get behavior native "HTMLMarqueeElement_behavior_Getter";
 
@@ -21380,7 +21376,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLMediaElementImpl extends _HTMLElementImpl implements MediaElement {
+class _MediaElementImpl extends _ElementImpl_Merged implements MediaElement {
 
   _MediaElementEventsImpl get on =>
     new _MediaElementEventsImpl(this);
@@ -21479,7 +21475,7 @@
 
   int get webkitVideoDecodedByteCount native "HTMLMediaElement_webkitVideoDecodedByteCount_Getter";
 
-  TextTrack addTextTrack(kind, [label, language]) {
+  TextTrack addTextTrack(/*DOMString*/ kind, [/*DOMString*/ label, /*DOMString*/ language]) {
     if (?language) {
       return _addTextTrack_1(kind, label, language);
     }
@@ -21503,7 +21499,7 @@
 
   void play() native "HTMLMediaElement_play_Callback";
 
-  void webkitAddKey(keySystem, key, [initData, sessionId]) {
+  void webkitAddKey(/*DOMString*/ keySystem, /*Uint8Array*/ key, [/*Uint8Array*/ initData, /*DOMString*/ sessionId]) {
     if (?initData) {
       _webkitAddKey_1(keySystem, key, initData, sessionId);
       return;
@@ -21517,7 +21513,7 @@
 
   void webkitCancelKeyRequest(String keySystem, String sessionId) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
 
-  void webkitGenerateKeyRequest(keySystem, [initData]) {
+  void webkitGenerateKeyRequest(/*DOMString*/ keySystem, [/*Uint8Array*/ initData]) {
     if (?initData) {
       _webkitGenerateKeyRequest_1(keySystem, initData);
       return;
@@ -22037,6 +22033,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(MediaStream element) => _Collections.contains(this, element);
+
   void forEach(void f(MediaStream element)) => _Collections.forEach(this, f);
 
   Collection map(f(MediaStream element)) => _Collections.map(this, [], f);
@@ -22052,7 +22050,7 @@
 
   // From List<MediaStream>:
 
-  void sort(int compare(MediaStream a, MediaStream b)) {
+  void sort([Comparator<MediaStream> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -22330,7 +22328,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLMenuElementImpl extends _HTMLElementImpl implements MenuElement {
+class _MenuElementImpl extends _ElementImpl_Merged implements MenuElement {
 
   bool get compact native "HTMLMenuElement_compact_Getter";
 
@@ -22514,7 +22512,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLMetaElementImpl extends _HTMLElementImpl implements MetaElement {
+class _MetaElementImpl extends _ElementImpl_Merged implements MetaElement {
 
   String get content native "HTMLMetaElement_content_Getter";
 
@@ -22554,7 +22552,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool MetadataCallback(Metadata metadata);
+typedef void MetadataCallback(Metadata metadata);
 // Copyright (c) 2012, 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.
@@ -22606,7 +22604,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLMeterElementImpl extends _HTMLElementImpl implements MeterElement {
+class _MeterElementImpl extends _ElementImpl_Merged implements MeterElement {
 
   num get high native "HTMLMeterElement_high_Getter";
 
@@ -22656,7 +22654,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLModElementImpl extends _HTMLElementImpl implements ModElement {
+class _ModElementImpl extends _ElementImpl_Merged implements ModElement {
 
   String get cite native "HTMLModElement_cite_Getter";
 
@@ -22803,7 +22801,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
+typedef void MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
 // Copyright (c) 2012, 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.
@@ -22876,14 +22874,14 @@
   List<MutationRecord> takeRecords();
 
   void observe(Node target,
-               [Map options,
+               {Map options,
                 bool childList,
                 bool attributes,
                 bool characterData,
                 bool subtree,
                 bool attributeOldValue,
                 bool characterDataOldValue,
-                List<String> attributeFilter]);
+                List<String> attributeFilter});
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -22898,14 +22896,14 @@
   List<MutationRecord> takeRecords() native "MutationObserver_takeRecords_Callback";
 
   void observe(Node target,
-               [Map options,
+               {Map options,
                 bool childList,
                 bool attributes,
                 bool characterData,
                 bool subtree,
                 bool attributeOldValue,
                 bool characterDataOldValue,
-                List<String> attributeFilter]) {
+                List<String> attributeFilter}) {
 
     // Parse options into map of known type.
     var parsedOptions = _createDict();
@@ -23096,6 +23094,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -23111,7 +23111,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -23299,7 +23299,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
+typedef void NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
 // Copyright (c) 2012, 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.
@@ -23317,7 +23317,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
+typedef void NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
 // Copyright (c) 2012, 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.
@@ -23548,6 +23548,8 @@
 
   // TODO(jacobr): We can implement these methods much more efficiently by
   // looking up the nodeList only once instead of once per iteration.
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -23565,7 +23567,7 @@
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw new UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -23774,6 +23776,8 @@
 
   Iterator<E> iterator() => _list.iterator();
 
+  bool contains(E element) => _list.contains(element);
+
   void forEach(void f(E element)) => _list.forEach(f);
 
   Collection map(f(E element)) => _list.map(f);
@@ -23800,7 +23804,7 @@
 
   void addAll(Collection<E> collection) => _list.addAll(collection);
 
-  void sort(int compare(E a, E b)) => _list.sort(compare);
+  void sort([Comparator<E> compare = Comparable.compare]) => _list.sort(compare);
 
   int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
 
@@ -23889,6 +23893,8 @@
     _parent.$dom_replaceChild(value, this[index]);
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -23904,7 +23910,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw new UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -24133,7 +24139,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool NotificationPermissionCallback(String permission);
+typedef void NotificationPermissionCallback(String permission);
 // Copyright (c) 2012, 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.
@@ -24241,7 +24247,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLOListElementImpl extends _HTMLElementImpl implements OListElement {
+class _OListElementImpl extends _ElementImpl_Merged implements OListElement {
 
   bool get compact native "HTMLOListElement_compact_Getter";
 
@@ -24346,7 +24352,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLObjectElementImpl extends _HTMLElementImpl implements ObjectElement {
+class _ObjectElementImpl extends _ElementImpl_Merged implements ObjectElement {
 
   String get align native "HTMLObjectElement_align_Getter";
 
@@ -24471,7 +24477,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLOptGroupElementImpl extends _HTMLElementImpl implements OptGroupElement {
+class _OptGroupElementImpl extends _ElementImpl_Merged implements OptGroupElement {
 
   bool get disabled native "HTMLOptGroupElement_disabled_Getter";
 
@@ -24534,7 +24540,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLOptionElementImpl extends _HTMLElementImpl implements OptionElement {
+class _OptionElementImpl extends _ElementImpl_Merged implements OptionElement {
 
   bool get defaultSelected native "HTMLOptionElement_defaultSelected_Getter";
 
@@ -24687,7 +24693,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLOutputElementImpl extends _HTMLElementImpl implements OutputElement {
+class _OutputElementImpl extends _ElementImpl_Merged implements OutputElement {
 
   String get defaultValue native "HTMLOutputElement_defaultValue_Getter";
 
@@ -24832,7 +24838,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLParagraphElementImpl extends _HTMLElementImpl implements ParagraphElement {
+class _ParagraphElementImpl extends _ElementImpl_Merged implements ParagraphElement {
 
   String get align native "HTMLParagraphElement_align_Getter";
 
@@ -24868,7 +24874,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLParamElementImpl extends _HTMLElementImpl implements ParamElement {
+class _ParamElementImpl extends _ElementImpl_Merged implements ParamElement {
 
   String get name native "HTMLParamElement_name_Getter";
 
@@ -25023,7 +25029,7 @@
 
   void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "PeerConnection00_addEventListener_Callback";
 
-  void addStream(stream, [mediaStreamHints]) {
+  void addStream(/*MediaStream*/ stream, [/*Dictionary*/ mediaStreamHints]) {
     if (?mediaStreamHints) {
       _addStream_1(stream, mediaStreamHints);
       return;
@@ -25037,7 +25043,7 @@
 
   void close() native "PeerConnection00_close_Callback";
 
-  SessionDescription createAnswer(offer, [mediaHints]) {
+  SessionDescription createAnswer(/*DOMString*/ offer, [/*Dictionary*/ mediaHints]) {
     if (?mediaHints) {
       return _createAnswer_1(offer, mediaHints);
     }
@@ -25048,7 +25054,7 @@
 
   SessionDescription _createAnswer_2(offer) native "PeerConnection00_createAnswer_2_Callback";
 
-  SessionDescription createOffer([mediaHints]) {
+  SessionDescription createOffer([/*Dictionary*/ mediaHints]) {
     if (?mediaHints) {
       return _createOffer_1(mediaHints);
     }
@@ -25071,7 +25077,7 @@
 
   void setRemoteDescription(int action, SessionDescription desc) native "PeerConnection00_setRemoteDescription_Callback";
 
-  void startIce([iceOptions]) {
+  void startIce([/*Dictionary*/ iceOptions]) {
     if (?iceOptions) {
       _startIce_1(iceOptions);
       return;
@@ -25318,7 +25324,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitPointImpl extends NativeFieldWrapperClass1 implements Point {
+class _PointImpl extends NativeFieldWrapperClass1 implements Point {
 
   num get x native "WebKitPoint_x_Getter";
 
@@ -25358,7 +25364,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool PositionCallback(Geoposition position);
+typedef void PositionCallback(Geoposition position);
 // Copyright (c) 2012, 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.
@@ -25386,7 +25392,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool PositionErrorCallback(PositionError error);
+typedef void PositionErrorCallback(PositionError error);
 // Copyright (c) 2012, 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.
@@ -25423,7 +25429,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLPreElementImpl extends _HTMLElementImpl implements PreElement {
+class _PreElementImpl extends _ElementImpl_Merged implements PreElement {
 
   int get width native "HTMLPreElement_width_Getter";
 
@@ -25498,7 +25504,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLProgressElementImpl extends _HTMLElementImpl implements ProgressElement {
+class _ProgressElementImpl extends _ElementImpl_Merged implements ProgressElement {
 
   List<Node> get labels native "HTMLProgressElement_labels_Getter";
 
@@ -25564,7 +25570,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLQuoteElementImpl extends _HTMLElementImpl implements QuoteElement {
+class _QuoteElementImpl extends _ElementImpl_Merged implements QuoteElement {
 
   String get cite native "HTMLQuoteElement_cite_Getter";
 
@@ -25610,7 +25616,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool RTCErrorCallback(String errorInformation);
+typedef void RTCErrorCallback(String errorInformation);
 // Copyright (c) 2012, 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.
@@ -25855,7 +25861,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool RTCSessionDescriptionCallback(RTCSessionDescription sdp);
+typedef void RTCSessionDescriptionCallback(RTCSessionDescription sdp);
 // Copyright (c) 2012, 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.
@@ -25879,7 +25885,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool RTCStatsCallback(RTCStatsResponse response);
+typedef void RTCStatsCallback(RTCStatsResponse response);
 // Copyright (c) 2012, 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.
@@ -26503,6 +26509,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Map element) => _Collections.contains(this, element);
+
   void forEach(void f(Map element)) => _Collections.forEach(this, f);
 
   Collection map(f(Map element)) => _Collections.map(this, [], f);
@@ -26518,7 +26526,7 @@
 
   // From List<Map>:
 
-  void sort(int compare(Map a, Map b)) {
+  void sort([Comparator<Map> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -26562,14 +26570,14 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLStatementCallback(SQLTransaction transaction, SQLResultSet resultSet);
+typedef void SQLStatementCallback(SQLTransaction transaction, SQLResultSet resultSet);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLStatementErrorCallback(SQLTransaction transaction, SQLError error);
+typedef void SQLStatementErrorCallback(SQLTransaction transaction, SQLError error);
 // Copyright (c) 2012, 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.
@@ -26588,14 +26596,14 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLTransactionCallback(SQLTransaction transaction);
+typedef void SQLTransactionCallback(SQLTransaction transaction);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLTransactionErrorCallback(SQLError error);
+typedef void SQLTransactionErrorCallback(SQLError error);
 // Copyright (c) 2012, 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.
@@ -26625,7 +26633,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool SQLTransactionSyncCallback(SQLTransactionSync transaction);
+typedef void SQLTransactionSyncCallback(SQLTransactionSync transaction);
 // Copyright (c) 2012, 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.
@@ -27110,6 +27118,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGAnimatedLength element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGAnimatedLength element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGAnimatedLength element)) => _Collections.map(this, [], f);
@@ -27125,7 +27135,7 @@
 
   // From List<SVGAnimatedLength>:
 
-  void sort(int compare(SVGAnimatedLength a, SVGAnimatedLength b)) {
+  void sort([Comparator<SVGAnimatedLength> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -27249,6 +27259,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGAnimatedNumber element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGAnimatedNumber element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGAnimatedNumber element)) => _Collections.map(this, [], f);
@@ -27264,7 +27276,7 @@
 
   // From List<SVGAnimatedNumber>:
 
-  void sort(int compare(SVGAnimatedNumber a, SVGAnimatedNumber b)) {
+  void sort([Comparator<SVGAnimatedNumber> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -27444,6 +27456,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGAnimateTransformElement element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGAnimateTransformElement element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGAnimateTransformElement element)) => _Collections.map(this, [], f);
@@ -27459,7 +27473,7 @@
 
   // From List<SVGAnimateTransformElement>:
 
-  void sort(int compare(SVGAnimateTransformElement a, SVGAnimateTransformElement b)) {
+  void sort([Comparator<SVGAnimateTransformElement> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -28323,6 +28337,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGElementInstance element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGElementInstance element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGElementInstance element)) => _Collections.map(this, [], f);
@@ -28338,7 +28354,7 @@
 
   // From List<SVGElementInstance>:
 
-  void sort(int compare(SVGElementInstance a, SVGElementInstance b)) {
+  void sort([Comparator<SVGElementInstance> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -30477,6 +30493,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGLength element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGLength element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGLength element)) => _Collections.map(this, [], f);
@@ -30492,7 +30510,7 @@
 
   // From List<SVGLength>:
 
-  void sort(int compare(SVGLength a, SVGLength b)) {
+  void sort([Comparator<SVGLength> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -31122,6 +31140,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGNumber element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGNumber element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGNumber element)) => _Collections.map(this, [], f);
@@ -31137,7 +31157,7 @@
 
   // From List<SVGNumber>:
 
-  void sort(int compare(SVGNumber a, SVGNumber b)) {
+  void sort([Comparator<SVGNumber> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -32262,6 +32282,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGPathSeg element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGPathSeg element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGPathSeg element)) => _Collections.map(this, [], f);
@@ -32277,7 +32299,7 @@
 
   // From List<SVGPathSeg>:
 
-  void sort(int compare(SVGPathSeg a, SVGPathSeg b)) {
+  void sort([Comparator<SVGPathSeg> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -33375,6 +33397,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(String element) => _Collections.contains(this, element);
+
   void forEach(void f(String element)) => _Collections.forEach(this, f);
 
   Collection map(f(String element)) => _Collections.map(this, [], f);
@@ -33390,7 +33414,7 @@
 
   // From List<String>:
 
-  void sort(int compare(String a, String b)) {
+  void sort([Comparator<String> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34079,6 +34103,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SVGTransform element) => _Collections.contains(this, element);
+
   void forEach(void f(SVGTransform element)) => _Collections.forEach(this, f);
 
   Collection map(f(SVGTransform element)) => _Collections.map(this, [], f);
@@ -34094,7 +34120,7 @@
 
   // From List<SVGTransform>:
 
-  void sort(int compare(SVGTransform a, SVGTransform b)) {
+  void sort([Comparator<SVGTransform> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -34560,7 +34586,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLScriptElementImpl extends _HTMLElementImpl implements ScriptElement {
+class _ScriptElementImpl extends _ElementImpl_Merged implements ScriptElement {
 
   bool get async native "HTMLScriptElement_async_Getter";
 
@@ -34771,7 +34797,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLSelectElementImpl extends _HTMLElementImpl implements SelectElement {
+class _SelectElementImpl extends _ElementImpl_Merged implements SelectElement {
 
   bool get autofocus native "HTMLSelectElement_autofocus_Getter";
 
@@ -34879,7 +34905,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLShadowElementImpl extends _HTMLElementImpl implements ShadowElement {
+class _ShadowElementImpl extends _ElementImpl_Merged implements ShadowElement {
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -35133,6 +35159,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SourceBuffer element) => _Collections.contains(this, element);
+
   void forEach(void f(SourceBuffer element)) => _Collections.forEach(this, f);
 
   Collection map(f(SourceBuffer element)) => _Collections.map(this, [], f);
@@ -35148,7 +35176,7 @@
 
   // From List<SourceBuffer>:
 
-  void sort(int compare(SourceBuffer a, SourceBuffer b)) {
+  void sort([Comparator<SourceBuffer> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -35218,7 +35246,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLSourceElementImpl extends _HTMLElementImpl implements SourceElement {
+class _SourceElementImpl extends _ElementImpl_Merged implements SourceElement {
 
   String get media native "HTMLSourceElement_media_Getter";
 
@@ -35250,7 +35278,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLSpanElementImpl extends _HTMLElementImpl implements SpanElement {
+class _SpanElementImpl extends _ElementImpl_Merged implements SpanElement {
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -35351,6 +35379,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SpeechGrammar element) => _Collections.contains(this, element);
+
   void forEach(void f(SpeechGrammar element)) => _Collections.forEach(this, f);
 
   Collection map(f(SpeechGrammar element)) => _Collections.map(this, [], f);
@@ -35366,7 +35396,7 @@
 
   // From List<SpeechGrammar>:
 
-  void sort(int compare(SpeechGrammar a, SpeechGrammar b)) {
+  void sort([Comparator<SpeechGrammar> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -35401,7 +35431,7 @@
 
   // -- end List<SpeechGrammar> mixins.
 
-  void addFromString(string, [weight]) {
+  void addFromString(/*DOMString*/ string, [/*float*/ weight]) {
     if (?weight) {
       _addFromString_1(string, weight);
       return;
@@ -35413,7 +35443,7 @@
 
   void _addFromString_2(string) native "SpeechGrammarList_addFromString_2_Callback";
 
-  void addFromUri(src, [weight]) {
+  void addFromUri(/*DOMString*/ src, [/*float*/ weight]) {
     if (?weight) {
       _addFromUri_1(src, weight);
       return;
@@ -35520,6 +35550,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SpeechInputResult element) => _Collections.contains(this, element);
+
   void forEach(void f(SpeechInputResult element)) => _Collections.forEach(this, f);
 
   Collection map(f(SpeechInputResult element)) => _Collections.map(this, [], f);
@@ -35535,7 +35567,7 @@
 
   // From List<SpeechInputResult>:
 
-  void sort(int compare(SpeechInputResult a, SpeechInputResult b)) {
+  void sort([Comparator<SpeechInputResult> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -35900,6 +35932,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(SpeechRecognitionResult element) => _Collections.contains(this, element);
+
   void forEach(void f(SpeechRecognitionResult element)) => _Collections.forEach(this, f);
 
   Collection map(f(SpeechRecognitionResult element)) => _Collections.map(this, [], f);
@@ -35915,7 +35949,7 @@
 
   // From List<SpeechRecognitionResult>:
 
-  void sort(int compare(SpeechRecognitionResult a, SpeechRecognitionResult b)) {
+  void sort([Comparator<SpeechRecognitionResult> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -36118,7 +36152,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StorageInfoErrorCallback(DOMException error);
+typedef void StorageInfoErrorCallback(DOMException error);
 // Copyright (c) 2012, 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.
@@ -36138,21 +36172,21 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StorageInfoQuotaCallback(int grantedQuotaInBytes);
+typedef void StorageInfoQuotaCallback(int grantedQuotaInBytes);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StorageInfoUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
+typedef void StorageInfoUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
 // Copyright (c) 2012, 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.
 
 // WARNING: Do not edit - generated code.
 
-typedef bool StringCallback(String data);
+typedef void StringCallback(String data);
 // Copyright (c) 2012, 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.
@@ -36185,7 +36219,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLStyleElementImpl extends _HTMLElementImpl implements StyleElement {
+class _StyleElementImpl extends _ElementImpl_Merged implements StyleElement {
 
   bool get disabled native "HTMLStyleElement_disabled_Getter";
 
@@ -36330,6 +36364,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(StyleSheet element) => _Collections.contains(this, element);
+
   void forEach(void f(StyleSheet element)) => _Collections.forEach(this, f);
 
   Collection map(f(StyleSheet element)) => _Collections.map(this, [], f);
@@ -36345,7 +36381,7 @@
 
   // From List<StyleSheet>:
 
-  void sort(int compare(StyleSheet a, StyleSheet b)) {
+  void sort([Comparator<StyleSheet> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -36403,7 +36439,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTableCaptionElementImpl extends _HTMLElementImpl implements TableCaptionElement {
+class _TableCaptionElementImpl extends _ElementImpl_Merged implements TableCaptionElement {
 
   String get align native "HTMLTableCaptionElement_align_Getter";
 
@@ -36472,7 +36508,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTableCellElementImpl extends _HTMLElementImpl implements TableCellElement {
+class _TableCellElementImpl extends _ElementImpl_Merged implements TableCellElement {
 
   String get abbr native "HTMLTableCellElement_abbr_Getter";
 
@@ -36568,7 +36604,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTableColElementImpl extends _HTMLElementImpl implements TableColElement {
+class _TableColElementImpl extends _ElementImpl_Merged implements TableColElement {
 
   String get align native "HTMLTableColElement_align_Getter";
 
@@ -36681,7 +36717,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTableElementImpl extends _HTMLElementImpl implements TableElement {
+class _TableElementImpl extends _ElementImpl_Merged implements TableElement {
 
   String get align native "HTMLTableElement_align_Getter";
 
@@ -36801,7 +36837,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTableRowElementImpl extends _HTMLElementImpl implements TableRowElement {
+class _TableRowElementImpl extends _ElementImpl_Merged implements TableRowElement {
 
   String get align native "HTMLTableRowElement_align_Getter";
 
@@ -36870,7 +36906,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTableSectionElementImpl extends _HTMLElementImpl implements TableSectionElement {
+class _TableSectionElementImpl extends _ElementImpl_Merged implements TableSectionElement {
 
   String get align native "HTMLTableSectionElement_align_Getter";
 
@@ -37010,7 +37046,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTextAreaElementImpl extends _HTMLElementImpl implements TextAreaElement {
+class _TextAreaElementImpl extends _ElementImpl_Merged implements TextAreaElement {
 
   bool get autofocus native "HTMLTextAreaElement_autofocus_Getter";
 
@@ -37092,7 +37128,7 @@
 
   void setCustomValidity(String error) native "HTMLTextAreaElement_setCustomValidity_Callback";
 
-  void setSelectionRange(start, end, [direction]) {
+  void setSelectionRange(/*long*/ start, /*long*/ end, [/*DOMString*/ direction]) {
     if (?direction) {
       _setSelectionRange_1(start, end, direction);
       return;
@@ -37427,6 +37463,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(TextTrackCue element) => _Collections.contains(this, element);
+
   void forEach(void f(TextTrackCue element)) => _Collections.forEach(this, f);
 
   Collection map(f(TextTrackCue element)) => _Collections.map(this, [], f);
@@ -37442,7 +37480,7 @@
 
   // From List<TextTrackCue>:
 
-  void sort(int compare(TextTrackCue a, TextTrackCue b)) {
+  void sort([Comparator<TextTrackCue> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -37602,6 +37640,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(TextTrack element) => _Collections.contains(this, element);
+
   void forEach(void f(TextTrack element)) => _Collections.forEach(this, f);
 
   Collection map(f(TextTrack element)) => _Collections.map(this, [], f);
@@ -37617,7 +37657,7 @@
 
   // From List<TextTrack>:
 
-  void sort(int compare(TextTrack a, TextTrack b)) {
+  void sort([Comparator<TextTrack> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -37724,7 +37764,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTitleElementImpl extends _HTMLElementImpl implements TitleElement {
+class _TitleElementImpl extends _ElementImpl_Merged implements TitleElement {
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -37919,6 +37959,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Touch element) => _Collections.contains(this, element);
+
   void forEach(void f(Touch element)) => _Collections.forEach(this, f);
 
   Collection map(f(Touch element)) => _Collections.map(this, [], f);
@@ -37934,7 +37976,7 @@
 
   // From List<Touch>:
 
-  void sort(int compare(Touch a, Touch b)) {
+  void sort([Comparator<Touch> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -38018,7 +38060,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLTrackElementImpl extends _HTMLElementImpl implements TrackElement {
+class _TrackElementImpl extends _ElementImpl_Merged implements TrackElement {
 
   bool get defaultValue native "HTMLTrackElement_default_Getter";
 
@@ -38089,7 +38131,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _WebKitTransitionEventImpl extends _EventImpl implements TransitionEvent {
+class _TransitionEventImpl extends _EventImpl implements TransitionEvent {
 
   num get elapsedTime native "WebKitTransitionEvent_elapsedTime_Getter";
 
@@ -38267,7 +38309,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLUListElementImpl extends _HTMLElementImpl implements UListElement {
+class _UListElementImpl extends _ElementImpl_Merged implements UListElement {
 
   bool get compact native "HTMLUListElement_compact_Getter";
 
@@ -38346,6 +38388,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -38361,7 +38405,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -38398,7 +38442,7 @@
 
   void setElements(Object array, [int offset]) native "Uint16Array_setElements_Callback";
 
-  Uint16Array subarray(start, [end]) {
+  Uint16Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -38478,6 +38522,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -38493,7 +38539,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -38530,7 +38576,7 @@
 
   void setElements(Object array, [int offset]) native "Uint32Array_setElements_Callback";
 
-  Uint32Array subarray(start, [end]) {
+  Uint32Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -38610,6 +38656,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(int element) => _Collections.contains(this, element);
+
   void forEach(void f(int element)) => _Collections.forEach(this, f);
 
   Collection map(f(int element)) => _Collections.map(this, [], f);
@@ -38625,7 +38673,7 @@
 
   // From List<int>:
 
-  void sort(int compare(int a, int b)) {
+  void sort([Comparator<int> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -38662,7 +38710,7 @@
 
   void setElements(Object array, [int offset]) native "Uint8Array_setElements_Callback";
 
-  Uint8Array subarray(start, [end]) {
+  Uint8Array subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -38717,7 +38765,7 @@
 
   void setElements(Object array, [int offset]) native "Uint8ClampedArray_setElements_Callback";
 
-  Uint8ClampedArray subarray(start, [end]) {
+  Uint8ClampedArray subarray(/*long*/ start, [/*long*/ end]) {
     if (?end) {
       return _subarray_1(start, end);
     }
@@ -38744,7 +38792,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLUnknownElementImpl extends _HTMLElementImpl implements UnknownElement {
+class _UnknownElementImpl extends _ElementImpl_Merged implements UnknownElement {
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -38866,7 +38914,7 @@
 
 // WARNING: Do not edit - generated code.
 
-class _HTMLVideoElementImpl extends _HTMLMediaElementImpl implements VideoElement {
+class _VideoElementImpl extends _MediaElementImpl implements VideoElement {
 
   int get height native "HTMLVideoElement_height_Getter";
 
@@ -38907,7 +38955,7 @@
 
 // WARNING: Do not edit - generated code.
 
-typedef bool VoidCallback();
+typedef void VoidCallback();
 // Copyright (c) 2012, 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.
@@ -40310,7 +40358,7 @@
 
   void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) native "WebGLRenderingContext_blendFuncSeparate_Callback";
 
-  void bufferData(target, data_OR_size, usage) {
+  void bufferData(/*unsigned long*/ target, data_OR_size, /*unsigned long*/ usage) {
     if ((target is int || target === null) && (data_OR_size is ArrayBuffer || data_OR_size === null) && (usage is int || usage === null)) {
       _bufferData_1(target, data_OR_size, usage);
       return;
@@ -40332,7 +40380,7 @@
 
   void _bufferData_3(target, data_OR_size, usage) native "WebGLRenderingContext_bufferData_3_Callback";
 
-  void bufferSubData(target, offset, data) {
+  void bufferSubData(/*unsigned long*/ target, /*long long*/ offset, data) {
     if ((target is int || target === null) && (offset is int || offset === null) && (data is ArrayBuffer || data === null)) {
       _bufferSubData_1(target, offset, data);
       return;
@@ -40524,7 +40572,7 @@
 
   void stencilOpSeparate(int face, int fail, int zfail, int zpass) native "WebGLRenderingContext_stencilOpSeparate_Callback";
 
-  void texImage2D(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [format, type, pixels]) {
+  void texImage2D(/*unsigned long*/ target, /*long*/ level, /*unsigned long*/ internalformat, /*long*/ format_OR_width, /*long*/ height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, [/*unsigned long*/ format, /*unsigned long*/ type, /*ArrayBufferView*/ pixels]) {
     if ((target is int || target === null) && (level is int || level === null) && (internalformat is int || internalformat === null) && (format_OR_width is int || format_OR_width === null) && (height_OR_type is int || height_OR_type === null) && (border_OR_canvas_OR_image_OR_pixels_OR_video is int || border_OR_canvas_OR_image_OR_pixels_OR_video === null) && (format is int || format === null) && (type is int || type === null) && (pixels is ArrayBufferView || pixels === null)) {
       _texImage2D_1(target, level, internalformat, format_OR_width, height_OR_type, border_OR_canvas_OR_image_OR_pixels_OR_video, format, type, pixels);
       return;
@@ -40562,7 +40610,7 @@
 
   void texParameteri(int target, int pname, int param) native "WebGLRenderingContext_texParameteri_Callback";
 
-  void texSubImage2D(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [type, pixels]) {
+  void texSubImage2D(/*unsigned long*/ target, /*long*/ level, /*long*/ xoffset, /*long*/ yoffset, /*long*/ format_OR_width, /*long*/ height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, [/*unsigned long*/ type, /*ArrayBufferView*/ pixels]) {
     if ((target is int || target === null) && (level is int || level === null) && (xoffset is int || xoffset === null) && (yoffset is int || yoffset === null) && (format_OR_width is int || format_OR_width === null) && (height_OR_type is int || height_OR_type === null) && (canvas_OR_format_OR_image_OR_pixels_OR_video is int || canvas_OR_format_OR_image_OR_pixels_OR_video === null) && (type is int || type === null) && (pixels is ArrayBufferView || pixels === null)) {
       _texSubImage2D_1(target, level, xoffset, yoffset, format_OR_width, height_OR_type, canvas_OR_format_OR_image_OR_pixels_OR_video, type, pixels);
       return;
@@ -40805,6 +40853,8 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+  bool contains(Animation element) => _Collections.contains(this, element);
+
   void forEach(void f(Animation element)) => _Collections.forEach(this, f);
 
   Collection map(f(Animation element)) => _Collections.map(this, [], f);
@@ -40820,7 +40870,7 @@
 
   // From List<Animation>:
 
-  void sort(int compare(Animation a, Animation b)) {
+  void sort([Comparator<Animation> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
@@ -41068,7 +41118,7 @@
 
   void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native "WebSocket_addEventListener_Callback";
 
-  void close([code, reason]) {
+  void close([/*unsigned short*/ code, /*DOMString*/ reason]) {
     if (?reason) {
       _close_1(code, reason);
       return;
@@ -41338,7 +41388,7 @@
   _WorkerEventsImpl get on =>
     new _WorkerEventsImpl(this);
 
-  void postMessage(message, [List messagePorts]) native "Worker_postMessage_Callback";
+  void postMessage(/*SerializedScriptValue*/ message, [List messagePorts]) native "Worker_postMessage_Callback";
 
   void terminate() native "Worker_terminate_Callback";
 
@@ -41810,135 +41860,135 @@
 
 
   static AnchorElement createAnchorElement([String href]) {
-    _HTMLAnchorElementImpl _e = _document.$dom_createElement("a");
+    _AnchorElementImpl _e = _document.$dom_createElement("a");
     if (href != null) _e.href = href;
     return _e;
   }
 
   static AreaElement createAreaElement() {
-    _HTMLAreaElementImpl _e = _document.$dom_createElement("area");
+    _AreaElementImpl _e = _document.$dom_createElement("area");
     return _e;
   }
 
   static BRElement createBRElement() {
-    _HTMLBRElementImpl _e = _document.$dom_createElement("br");
+    _BRElementImpl _e = _document.$dom_createElement("br");
     return _e;
   }
 
   static BaseElement createBaseElement() {
-    _HTMLBaseElementImpl _e = _document.$dom_createElement("base");
+    _BaseElementImpl _e = _document.$dom_createElement("base");
     return _e;
   }
 
   static BodyElement createBodyElement() {
-    _HTMLBodyElementImpl _e = _document.$dom_createElement("body");
+    _BodyElementImpl _e = _document.$dom_createElement("body");
     return _e;
   }
 
   static ButtonElement createButtonElement() {
-    _HTMLButtonElementImpl _e = _document.$dom_createElement("button");
+    _ButtonElementImpl _e = _document.$dom_createElement("button");
     return _e;
   }
 
   static CanvasElement createCanvasElement([int width, int height]) {
-    _HTMLCanvasElementImpl _e = _document.$dom_createElement("canvas");
+    _CanvasElementImpl _e = _document.$dom_createElement("canvas");
     if (width != null) _e.width = width;
     if (height != null) _e.height = height;
     return _e;
   }
 
   static ContentElement createContentElement() {
-    _HTMLContentElementImpl _e = _document.$dom_createElement("content");
+    _ContentElementImpl _e = _document.$dom_createElement("content");
     return _e;
   }
 
   static DListElement createDListElement() {
-    _HTMLDListElementImpl _e = _document.$dom_createElement("dl");
+    _DListElementImpl _e = _document.$dom_createElement("dl");
     return _e;
   }
 
   static DataListElement createDataListElement() {
-    _HTMLDataListElementImpl _e = _document.$dom_createElement("datalist");
+    _DataListElementImpl _e = _document.$dom_createElement("datalist");
     return _e;
   }
 
   static DetailsElement createDetailsElement() {
-    _HTMLDetailsElementImpl _e = _document.$dom_createElement("details");
+    _DetailsElementImpl _e = _document.$dom_createElement("details");
     return _e;
   }
 
   static DivElement createDivElement() {
-    _HTMLDivElementImpl _e = _document.$dom_createElement("div");
+    _DivElementImpl _e = _document.$dom_createElement("div");
     return _e;
   }
 
   static EmbedElement createEmbedElement() {
-    _HTMLEmbedElementImpl _e = _document.$dom_createElement("embed");
+    _EmbedElementImpl _e = _document.$dom_createElement("embed");
     return _e;
   }
 
   static FieldSetElement createFieldSetElement() {
-    _HTMLFieldSetElementImpl _e = _document.$dom_createElement("fieldset");
+    _FieldSetElementImpl _e = _document.$dom_createElement("fieldset");
     return _e;
   }
 
   static FormElement createFormElement() {
-    _HTMLFormElementImpl _e = _document.$dom_createElement("form");
+    _FormElementImpl _e = _document.$dom_createElement("form");
     return _e;
   }
 
   static HRElement createHRElement() {
-    _HTMLHRElementImpl _e = _document.$dom_createElement("hr");
+    _HRElementImpl _e = _document.$dom_createElement("hr");
     return _e;
   }
 
   static HeadElement createHeadElement() {
-    _HTMLHeadElementImpl _e = _document.$dom_createElement("head");
+    _HeadElementImpl _e = _document.$dom_createElement("head");
     return _e;
   }
 
   static HeadingElement createHeadingElement_h1() {
-    _HTMLHeadingElementImpl _e = _document.$dom_createElement("h1");
+    _HeadingElementImpl _e = _document.$dom_createElement("h1");
     return _e;
   }
 
   static HeadingElement createHeadingElement_h2() {
-    _HTMLHeadingElementImpl _e = _document.$dom_createElement("h2");
+    _HeadingElementImpl _e = _document.$dom_createElement("h2");
     return _e;
   }
 
   static HeadingElement createHeadingElement_h3() {
-    _HTMLHeadingElementImpl _e = _document.$dom_createElement("h3");
+    _HeadingElementImpl _e = _document.$dom_createElement("h3");
     return _e;
   }
 
   static HeadingElement createHeadingElement_h4() {
-    _HTMLHeadingElementImpl _e = _document.$dom_createElement("h4");
+    _HeadingElementImpl _e = _document.$dom_createElement("h4");
     return _e;
   }
 
   static HeadingElement createHeadingElement_h5() {
-    _HTMLHeadingElementImpl _e = _document.$dom_createElement("h5");
+    _HeadingElementImpl _e = _document.$dom_createElement("h5");
     return _e;
   }
 
   static HeadingElement createHeadingElement_h6() {
-    _HTMLHeadingElementImpl _e = _document.$dom_createElement("h6");
+    _HeadingElementImpl _e = _document.$dom_createElement("h6");
     return _e;
   }
 
   static HtmlElement createHtmlElement() {
-    _HTMLHtmlElementImpl _e = _document.$dom_createElement("html");
+    _HtmlElementImpl _e = _document.$dom_createElement("html");
     return _e;
   }
 
   static IFrameElement createIFrameElement() {
-    _HTMLIFrameElementImpl _e = _document.$dom_createElement("iframe");
+    _IFrameElementImpl _e = _document.$dom_createElement("iframe");
     return _e;
   }
 
   static ImageElement createImageElement([String src, int width, int height]) {
-    _HTMLImageElementImpl _e = _document.$dom_createElement("img");
+    _ImageElementImpl _e = _document.$dom_createElement("img");
     if (src != null) _e.src = src;
     if (width != null) _e.width = width;
     if (height != null) _e.height = height;
@@ -41946,163 +41996,163 @@
   }
 
   static InputElement createInputElement([String type]) {
-    _HTMLInputElementImpl _e = _document.$dom_createElement("input");
+    _InputElementImpl _e = _document.$dom_createElement("input");
     if (type != null) _e.type = type;
     return _e;
   }
 
   static KeygenElement createKeygenElement() {
-    _HTMLKeygenElementImpl _e = _document.$dom_createElement("keygen");
+    _KeygenElementImpl _e = _document.$dom_createElement("keygen");
     return _e;
   }
 
   static LIElement createLIElement() {
-    _HTMLLIElementImpl _e = _document.$dom_createElement("li");
+    _LIElementImpl _e = _document.$dom_createElement("li");
     return _e;
   }
 
   static LabelElement createLabelElement() {
-    _HTMLLabelElementImpl _e = _document.$dom_createElement("label");
+    _LabelElementImpl _e = _document.$dom_createElement("label");
     return _e;
   }
 
   static LegendElement createLegendElement() {
-    _HTMLLegendElementImpl _e = _document.$dom_createElement("legend");
+    _LegendElementImpl _e = _document.$dom_createElement("legend");
     return _e;
   }
 
   static LinkElement createLinkElement() {
-    _HTMLLinkElementImpl _e = _document.$dom_createElement("link");
+    _LinkElementImpl _e = _document.$dom_createElement("link");
     return _e;
   }
 
   static MapElement createMapElement() {
-    _HTMLMapElementImpl _e = _document.$dom_createElement("map");
+    _MapElementImpl _e = _document.$dom_createElement("map");
     return _e;
   }
 
   static MenuElement createMenuElement() {
-    _HTMLMenuElementImpl _e = _document.$dom_createElement("menu");
+    _MenuElementImpl _e = _document.$dom_createElement("menu");
     return _e;
   }
 
   static MeterElement createMeterElement() {
-    _HTMLMeterElementImpl _e = _document.$dom_createElement("meter");
+    _MeterElementImpl _e = _document.$dom_createElement("meter");
     return _e;
   }
 
   static OListElement createOListElement() {
-    _HTMLOListElementImpl _e = _document.$dom_createElement("ol");
+    _OListElementImpl _e = _document.$dom_createElement("ol");
     return _e;
   }
 
   static ObjectElement createObjectElement() {
-    _HTMLObjectElementImpl _e = _document.$dom_createElement("object");
+    _ObjectElementImpl _e = _document.$dom_createElement("object");
     return _e;
   }
 
   static OptGroupElement createOptGroupElement() {
-    _HTMLOptGroupElementImpl _e = _document.$dom_createElement("optgroup");
+    _OptGroupElementImpl _e = _document.$dom_createElement("optgroup");
     return _e;
   }
 
   static OutputElement createOutputElement() {
-    _HTMLOutputElementImpl _e = _document.$dom_createElement("output");
+    _OutputElementImpl _e = _document.$dom_createElement("output");
     return _e;
   }
 
   static ParagraphElement createParagraphElement() {
-    _HTMLParagraphElementImpl _e = _document.$dom_createElement("p");
+    _ParagraphElementImpl _e = _document.$dom_createElement("p");
     return _e;
   }
 
   static ParamElement createParamElement() {
-    _HTMLParamElementImpl _e = _document.$dom_createElement("param");
+    _ParamElementImpl _e = _document.$dom_createElement("param");
     return _e;
   }
 
   static PreElement createPreElement() {
-    _HTMLPreElementImpl _e = _document.$dom_createElement("pre");
+    _PreElementImpl _e = _document.$dom_createElement("pre");
     return _e;
   }
 
   static ProgressElement createProgressElement() {
-    _HTMLProgressElementImpl _e = _document.$dom_createElement("progress");
+    _ProgressElementImpl _e = _document.$dom_createElement("progress");
     return _e;
   }
 
   static ScriptElement createScriptElement() {
-    _HTMLScriptElementImpl _e = _document.$dom_createElement("script");
+    _ScriptElementImpl _e = _document.$dom_createElement("script");
     return _e;
   }
 
   static SelectElement createSelectElement() {
-    _HTMLSelectElementImpl _e = _document.$dom_createElement("select");
+    _SelectElementImpl _e = _document.$dom_createElement("select");
     return _e;
   }
 
   static SourceElement createSourceElement() {
-    _HTMLSourceElementImpl _e = _document.$dom_createElement("source");
+    _SourceElementImpl _e = _document.$dom_createElement("source");
     return _e;
   }
 
   static SpanElement createSpanElement() {
-    _HTMLSpanElementImpl _e = _document.$dom_createElement("span");
+    _SpanElementImpl _e = _document.$dom_createElement("span");
     return _e;
   }
 
   static StyleElement createStyleElement() {
-    _HTMLStyleElementImpl _e = _document.$dom_createElement("style");
+    _StyleElementImpl _e = _document.$dom_createElement("style");
     return _e;
   }
 
   static TableCaptionElement createTableCaptionElement() {
-    _HTMLTableCaptionElementImpl _e = _document.$dom_createElement("caption");
+    _TableCaptionElementImpl _e = _document.$dom_createElement("caption");
     return _e;
   }
 
   static TableCellElement createTableCellElement() {
-    _HTMLTableCellElementImpl _e = _document.$dom_createElement("td");
+    _TableCellElementImpl _e = _document.$dom_createElement("td");
     return _e;
   }
 
   static TableColElement createTableColElement() {
-    _HTMLTableColElementImpl _e = _document.$dom_createElement("col");
+    _TableColElementImpl _e = _document.$dom_createElement("col");
     return _e;
   }
 
   static TableElement createTableElement() {
-    _HTMLTableElementImpl _e = _document.$dom_createElement("table");
+    _TableElementImpl _e = _document.$dom_createElement("table");
     return _e;
   }
 
   static TableRowElement createTableRowElement() {
-    _HTMLTableRowElementImpl _e = _document.$dom_createElement("tr");
+    _TableRowElementImpl _e = _document.$dom_createElement("tr");
     return _e;
   }
 
   static TextAreaElement createTextAreaElement() {
-    _HTMLTextAreaElementImpl _e = _document.$dom_createElement("textarea");
+    _TextAreaElementImpl _e = _document.$dom_createElement("textarea");
     return _e;
   }
 
   static TitleElement createTitleElement() {
-    _HTMLTitleElementImpl _e = _document.$dom_createElement("title");
+    _TitleElementImpl _e = _document.$dom_createElement("title");
     return _e;
   }
 
   static TrackElement createTrackElement() {
-    _HTMLTrackElementImpl _e = _document.$dom_createElement("track");
+    _TrackElementImpl _e = _document.$dom_createElement("track");
     return _e;
   }
 
   static UListElement createUListElement() {
-    _HTMLUListElementImpl _e = _document.$dom_createElement("ul");
+    _UListElementImpl _e = _document.$dom_createElement("ul");
     return _e;
   }
 
   static VideoElement createVideoElement() {
-    _HTMLVideoElementImpl _e = _document.$dom_createElement("video");
+    _VideoElementImpl _e = _document.$dom_createElement("video");
     return _e;
   }
 }
@@ -42974,6 +43024,13 @@
  * method.
  */
 class _Collections {
+  static bool contains(Iterable<Object> iterable, Object element) {
+    for (final e in iterable) {
+      if (e == element) return true;
+    }
+    return false;
+  }
+
   static void forEach(Iterable<Object> iterable, void f(Object o)) {
     for (final e in iterable) {
       f(e);
@@ -43608,7 +43665,7 @@
     // so we just make a dummy event and listen for that.
     _observer = new MutationObserver(this._handleMutation);
     _dummy = new DivElement();
-    _observer.observe(_dummy, {}, attributes: true);
+    _observer.observe(_dummy, attributes: true);
   }
 
   void _schedule() {
diff --git a/lib/html/idl/dart/dart.idl b/lib/html/idl/dart/dart.idl
index 86017f6..2a319ae 100644
--- a/lib/html/idl/dart/dart.idl
+++ b/lib/html/idl/dart/dart.idl
@@ -146,22 +146,22 @@
     //void         compressedTexImage2D(in unsigned long target, in long level, in unsigned long internalformat, in unsigned long width, in unsigned long height, in long border, in unsigned long imageSize, const void* data);
     //void         compressedTexSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, in unsigned long width, in unsigned long height, in unsigned long format, in unsigned long imageSize, const void* data);
 
-    any getBufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+    [Custom] any getBufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getBufferParameter();
 
-    any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException);
+    [Custom] any getFramebufferAttachmentParameter(in unsigned long target, in unsigned long attachment, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getFramebufferAttachmentParameter();
 
-    any getParameter(in unsigned long pname) raises(DOMException);
+    [Custom] any getParameter(in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getParameter();
 
-    any getProgramParameter(in WebGLProgram program, in unsigned long pname) raises(DOMException);
+    [Custom] any getProgramParameter(in WebGLProgram program, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getProgramParameter();
 
-    any getRenderbufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+    [Custom] any getRenderbufferParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getRenderbufferParameter();
 
-    any getShaderParameter(in WebGLShader shader, in unsigned long pname) raises(DOMException);
+    [Custom] any getShaderParameter(in WebGLShader shader, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getShaderParameter() raises(DOMException);
 
     // TBD
@@ -170,13 +170,13 @@
     DOMString[] getSupportedExtensions();
     [Suppressed, StrictTypeChecking, Custom] void getSupportedExtensions();
 
-    any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
+    [Custom] any getTexParameter(in unsigned long target, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getTexParameter();
 
-    any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException);
+    [Custom] any getUniform(in WebGLProgram program, in WebGLUniformLocation location) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getUniform();
 
-    any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException);
+    [Custom] any getVertexAttrib(in unsigned long index, in unsigned long pname) raises(DOMException);
     [Suppressed, StrictTypeChecking, Custom] void getVertexAttrib();
   };
 }
@@ -384,10 +384,6 @@
 }
 
 module core {
-  [Supplemental, Callback]
-  interface RequestAnimationFrameCallback {
-    // Webkit implements this as returning bool, but standard is void.
-    [Suppressed] boolean handleEvent(in DOMTimeStamp time);
-    [Custom] void handleEvent(in DOMTimeStamp time);
-  };
+  [Suppressed]
+  interface Entity {};
 }
diff --git a/lib/html/scripts/dartgenerator_test.py b/lib/html/scripts/dartgenerator_test.py
index f213156..f065eb2 100755
--- a/lib/html/scripts/dartgenerator_test.py
+++ b/lib/html/scripts/dartgenerator_test.py
@@ -123,10 +123,8 @@
     parser = idlparser.IDLParser(idlparser.FREMONTCUT_SYNTAX)
     ast = parser.parse(content)
     idl_file = idlnode.IDLFile(ast)
-    for module in idl_file.modules:
-      module_name = module.id
-      for interface in module.interfaces:
-        db.AddInterface(interface)
+    for interface in idl_file.interfaces:
+      db.AddInterface(interface)
     db.Save()
 
     self.assertTrue(self._InDatabase('Shape'))
diff --git a/lib/html/scripts/databasebuilder.py b/lib/html/scripts/databasebuilder.py
index c3e14f7..d75d033 100755
--- a/lib/html/scripts/databasebuilder.py
+++ b/lib/html/scripts/databasebuilder.py
@@ -21,10 +21,6 @@
 # which implements a displaced declaration.
 _VIA_ANNOTATION_ATTR_NAME = 'via'
 
-# Used in source annotations to specify the module that the interface was
-# imported from.
-_MODULE_ANNOTATION_ATTR_NAME = 'module'
-
 
 class DatabaseBuilderOptions(object):
   """Used in specifying options when importing new interfaces"""
@@ -137,7 +133,7 @@
     map(rename_node, idl_file.all(IDLType))
     map(rename_ext_attrs, idl_file.all(IDLExtAttrs))
 
-  def _annotate(self, interface, module_name, import_options):
+  def _annotate(self, interface, import_options):
     """Adds @ annotations based on the source and source_attributes
     members of import_options."""
 
@@ -155,7 +151,6 @@
         annotation['suppressed'] = None
 
     add_source_annotation(interface)
-    interface.annotations[source][_MODULE_ANNOTATION_ATTR_NAME] = module_name
 
     map(add_source_annotation, interface.parents)
     map(add_source_annotation, interface.constants)
@@ -395,11 +390,11 @@
     """Merges all imported interfaces and loads them into the DB."""
 
     # Step 1: Pre process imported interfaces
-    for interface, module_name, import_options in self._imported_interfaces:
-      self._annotate(interface, module_name, import_options)
+    for interface, import_options in self._imported_interfaces:
+      self._annotate(interface, import_options)
 
     # Step 2: Add all new interfaces and merge overlapping ones
-    for interface, module_name, import_options in self._imported_interfaces:
+    for interface, import_options in self._imported_interfaces:
       if not interface.is_supplemental:
         if self._database.HasInterface(interface.id):
           old_interface = self._database.GetInterface(interface.id)
@@ -409,7 +404,7 @@
             self._database.AddInterface(interface)
 
     # Step 3: Merge in supplemental interfaces
-    for interface, module_name, import_options in self._imported_interfaces:
+    for interface, import_options in self._imported_interfaces:
       if interface.is_supplemental:
         target_name = interface.ext_attrs['Supplemental']
         if target_name:
@@ -469,21 +464,21 @@
     def enabled(idl_node):
       return self._is_node_enabled(idl_node, import_options.idl_defines)
 
-    for module in idl_file.modules:
-      for interface in module.interfaces:
-        if not self._is_node_enabled(interface, import_options.idl_defines):
-          _logger.info('skipping interface %s/%s (source=%s)'
-            % (module.id, interface.id, import_options.source))
-          continue
+    for interface in idl_file.interfaces:
+      if not self._is_node_enabled(interface, import_options.idl_defines):
+        _logger.info('skipping interface %s (source=%s)'
+          % (interface.id, import_options.source))
+        continue
 
-        _logger.info('importing interface %s/%s (source=%s)'
-          % (module.id, interface.id, import_options.source))
-        interface.attributes = filter(enabled, interface.attributes)
-        interface.operations = filter(enabled, interface.operations)
-        self._imported_interfaces.append((interface, module.id, import_options))
+      _logger.info('importing interface %s (source=%s)'
+        % (interface.id, import_options.source))
+      interface.attributes = filter(enabled, interface.attributes)
+      interface.operations = filter(enabled, interface.operations)
+      self._imported_interfaces.append((interface, import_options))
 
-      for implStmt in module.implementsStatements:
-        self._impl_stmts.append((implStmt, import_options))
+    for implStmt in idl_file.implementsStatements:
+      self._impl_stmts.append((implStmt, import_options))
+
 
   def _is_node_enabled(self, node, idl_defines):
     if not 'Conditional' in node.ext_attrs:
diff --git a/lib/html/scripts/generator.py b/lib/html/scripts/generator.py
index da62d88..c8ab91a 100644
--- a/lib/html/scripts/generator.py
+++ b/lib/html/scripts/generator.py
@@ -148,21 +148,19 @@
   Attributes:
     name: Name of parameter.
     type_id: Original type id.  None for merged types.
-    dart_type: DartType of parameter.
     is_optional: Parameter optionality.
   """
-  def __init__(self, name, type_id, dart_type, is_optional):
+  def __init__(self, name, type_id, is_optional):
     self.name = name
     self.type_id = type_id
-    self.dart_type = dart_type
     self.is_optional = is_optional
 
   def Copy(self):
-    return ParamInfo(self.name, self.type_id, self.dart_type, self.is_optional)
+    return ParamInfo(self.name, self.type_id, self.is_optional)
 
   def __repr__(self):
-    content = 'name = %s, type_id = %s, dart_type = %s, is_optional = %s' % (
-        self.name, self.type_id, self.dart_type, self.is_optional)
+    content = 'name = %s, type_id = %s, is_optional = %s' % (
+        self.name, self.type_id, self.is_optional)
     return '<ParamInfo(%s)>' % content
 
 
@@ -191,12 +189,9 @@
   def OverloadedType(args):
     type_ids = sorted(set(arg.type.id for arg in args))
     if len(set(DartType(arg.type.id) for arg in args)) == 1:
-      if len(type_ids) == 1:
-        return (type_ids[0], type_ids[0])
-      else:
-        return (None, type_ids[0])
+      return type_ids[0]
     else:
-      return (None, TypeName(type_ids, interface))
+      return None
 
   result = []
 
@@ -205,9 +200,9 @@
     is_optional = is_optional or any(arg is None or IsOptional(arg) for arg in arg_tuple)
 
     filtered = filter(None, arg_tuple)
-    (type_id, dart_type) = OverloadedType(filtered)
+    type_id = OverloadedType(filtered)
     name = OverloadedName(filtered)
-    result.append(ParamInfo(name, type_id, dart_type, is_optional))
+    result.append(ParamInfo(name, type_id, is_optional))
 
   return result
 
@@ -242,6 +237,7 @@
   info.js_name = info.declared_name
   info.type_name = operations[0].type.id   # TODO: widen.
   info.param_infos = _BuildArguments([op.arguments for op in split_operations], interface)
+  info.requires_named_arguments = False
   return info
 
 
@@ -275,6 +271,7 @@
   info.js_name = name
   info.type_name = interface.id
   info.param_infos = args
+  info.requires_named_arguments = False
   return info
 
 def IsDartListType(type):
@@ -344,31 +341,30 @@
     param_infos: A list of ParamInfo.
   """
 
-  def ParametersInterfaceDeclaration(self, rename_type):
-    """Returns a formatted string declaring the parameters for the interface."""
-    def type_function(param):
-      # TODO(podivilov): replace param.dart_type field with param.is_optional
-      dart_type = param.dart_type
-      if dart_type != 'Dynamic':
-        dart_type = rename_type(dart_type)
-      return TypeOrNothing(dart_type, param.type_id)
-    return self._FormatParams(self.param_infos, None, type_function)
+  def ParametersDeclaration(self, rename_type, force_optional=False):
+    def FormatParam(param):
+      dart_type = rename_type(param.type_id) if param.type_id else 'Dynamic'
+      return '%s%s' % (TypeOrNothing(dart_type, param.type_id), param.name)
 
-  def ParametersImplementationDeclaration(self, rename_type):
-    """Returns a formatted string declaring the parameters for the
-    implementation.
-
-    Args:
-      rename_type: A function that allows the types to be renamed.
-        The function is applied to the parameter's dart_type.
-    """
-    def type_function(param):
-      # TODO(podivilov): replace param.dart_type field with param.is_optional
-      dart_type = param.dart_type
-      if dart_type != 'Dynamic':
-        dart_type = rename_type(dart_type)
-      return TypeOrNothing(dart_type)
-    return self._FormatParams(self.param_infos, 'null', type_function)
+    required = []
+    optional = []
+    for param_info in self.param_infos:
+      if param_info.is_optional:
+        optional.append(param_info)
+      else:
+        if optional:
+          raise Exception('Optional parameters cannot precede required ones: '
+                          + str(params))
+        required.append(param_info)
+    argtexts = map(FormatParam, required)
+    if optional:
+      needs_named = self.requires_named_arguments and not force_optional
+      left_bracket, right_bracket = '{}' if needs_named else '[]'
+      argtexts.append(
+          left_bracket +
+          ', '.join(map(FormatParam, optional)) +
+          right_bracket)
+    return ', '.join(argtexts)
 
   def ParametersAsArgumentList(self, parameter_count = None):
     """Returns a string of the parameter names suitable for passing the
@@ -380,29 +376,6 @@
         lambda param_info: param_info.name,
         self.param_infos[:parameter_count]))
 
-  def _FormatParams(self, params, default_value, type_fn):
-    def FormatParam(param):
-      """Returns a parameter declaration fragment for an ParamInfo."""
-      type = type_fn(param)
-      if param.is_optional and default_value and default_value != 'null':
-        return '%s%s = %s' % (type, param.name, default_value)
-      return '%s%s' % (type, param.name)
-
-    required = []
-    optional = []
-    for param_info in params:
-      if param_info.is_optional:
-        optional.append(param_info)
-      else:
-        if optional:
-          raise Exception('Optional parameters cannot precede required ones: '
-                          + str(params))
-        required.append(param_info)
-    argtexts = map(FormatParam, required)
-    if optional:
-      argtexts.append('[' + ', '.join(map(FormatParam, optional)) + ']')
-    return ', '.join(argtexts)
-
   def IsStatic(self):
     is_static = self.overloads[0].is_static
     assert any([is_static == o.is_static for o in self.overloads])
@@ -428,7 +401,7 @@
           '  factory $CTOR($PARAMS) => '
           '$FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n',
           CTOR=self._ConstructorFullName(rename_type),
-          PARAMS=self.ParametersInterfaceDeclaration(rename_type),
+          PARAMS=self.ParametersDeclaration(rename_type),
           FACTORY=factory_provider,
           CTOR_FACTORY_NAME=factory_name,
           FACTORY_PARAMS=self.ParametersAsArgumentList())
@@ -441,7 +414,7 @@
         '    return $FACTORY.$CTOR_FACTORY_NAME($FACTORY_PARAMS);\n'
         '  }\n',
         CTOR=self._ConstructorFullName(rename_type),
-        PARAMS=self.ParametersInterfaceDeclaration(rename_type),
+        PARAMS=self.ParametersDeclaration(rename_type),
         FACTORY=factory_provider,
         CTOR_FACTORY_NAME=factory_name,
         FACTORY_PARAMS=self.ParametersAsArgumentList())
@@ -469,7 +442,7 @@
     info.param_infos = [param.Copy() for param in self.param_infos]
     for param in info.param_infos:
       if param.is_optional:
-        param.dart_type = 'Dynamic'
+        param.type_id = None
     return info
 
 
@@ -737,13 +710,17 @@
       return self.dart_type()
     if IsPureInterface(self.idl_type()):
       return self.idl_type()
-    return self.implementation_name()
+    return ImplementationClassNameForInterfaceName(self.interface_name())
 
   def interface_name(self):
     return self._dart_interface_name
 
   def implementation_name(self):
-    return ImplementationClassNameForInterfaceName(self._dart_interface_name)
+    implementation_name = ImplementationClassNameForInterfaceName(
+        self.interface_name())
+    if self.merged_into():
+      implementation_name = '%s_Merged' % implementation_name
+    return implementation_name
 
   def has_generated_interface(self):
     return True
@@ -1004,7 +981,6 @@
 
     'CSSRule': TypeData(clazz='Interface', conversion_includes=['CSSImportRule']),
     'DOMException': TypeData(clazz='Interface', native_type='DOMCoreException'),
-    'DOMStringList': TypeData(clazz='Interface', dart_type='List<String>', custom_to_native=True),
     'DOMStringMap': TypeData(clazz='Interface', dart_type='Map<String, String>'),
     'DOMWindow': TypeData(clazz='Interface', custom_to_dart=True),
     'Document': TypeData(clazz='Interface', merged_interface='HTMLDocument'),
@@ -1025,6 +1001,8 @@
     'ClientRectList': TypeData(clazz='ListLike', item_type='ClientRect'),
     'CSSRuleList': TypeData(clazz='ListLike', item_type='CSSRule'),
     'CSSValueList': TypeData(clazz='ListLike', item_type='CSSValue'),
+    'DOMStringList': TypeData(clazz='ListLike', item_type='DOMString',
+        custom_to_native=True),
     'EntryArray': TypeData(clazz='ListLike', item_type='Entry'),
     'EntryArraySync': TypeData(clazz='ListLike', item_type='EntrySync'),
     'FileList': TypeData(clazz='ListLike', item_type='File'),
diff --git a/lib/html/scripts/idlnode.py b/lib/html/scripts/idlnode.py
index 511cfe6..3ce84d0 100755
--- a/lib/html/scripts/idlnode.py
+++ b/lib/html/scripts/idlnode.py
@@ -9,7 +9,7 @@
 class IDLNode(object):
   """Base class for all IDL elements.
   IDLNode may contain various child nodes, and have properties. Examples
-  of IDLNode are modules, interfaces, interface members, function arguments,
+  of IDLNode are interfaces, interface members, function arguments,
   etc.
   """
 
@@ -245,14 +245,18 @@
 
 
 class IDLFile(IDLNode):
-  """IDLFile is the top-level node in each IDL file. It may contain
-  modules or interfaces."""
+  """IDLFile is the top-level node in each IDL file. It may contain interfaces."""
 
   def __init__(self, ast, filename=None):
     IDLNode.__init__(self, ast)
     self.filename = filename
-    self.modules = self._convert_all(ast, 'Module', IDLModule)
     self.interfaces = self._convert_all(ast, 'Interface', IDLInterface)
+    modules = self._convert_all(ast, 'Module', IDLModule)
+    self.implementsStatements = self._convert_all(ast, 'ImplStmt',
+      IDLImplementsStatement)
+    for module in modules:
+      self.interfaces.extend(module.interfaces)
+      self.implementsStatements.extend(module.implementsStatements)
 
 
 class IDLModule(IDLNode):
diff --git a/lib/html/scripts/idlparser.py b/lib/html/scripts/idlparser.py
index 65ccdac..fa90576 100755
--- a/lib/html/scripts/idlparser.py
+++ b/lib/html/scripts/idlparser.py
@@ -90,7 +90,7 @@
         [MAYBE(ExtAttrs), 'interface', Id, MAYBE(_ParentInterfaces),
          MAYBE(['{', MAYBE(MANY(_Member)), '}']), ';'],
         # WebKit:
-        [OR('interface', 'exception'), MAYBE(ExtAttrs), Id, MAYBE(_ParentInterfaces),
+        [MAYBE(ExtAttrs), OR('interface', 'exception'), MAYBE(ExtAttrs), Id, MAYBE(_ParentInterfaces),
          MAYBE(['{', MAYBE(MANY(_Member)), '}']), MAYBE(';')],
         # FremontCut:
         [MAYBE(_Annotations), MAYBE(ExtAttrs), 'interface',
@@ -171,8 +171,10 @@
         [MAYBE(ExtAttrs), MAYBE(Stringifier), MAYBE(ReadOnly),
          'attribute', Type, Id, MAYBE(_AttrRaises), ';'],
         # WebKit:
-        [MAYBE(Stringifier), MAYBE(Static), MAYBE(ReadOnly), 'attribute',
-         MAYBE(ExtAttrs), Type, Id, MAYBE(_AttrRaises), ';'],
+        [
+          MAYBE(Stringifier),
+          MAYBE(ExtAttrs), MAYBE(Static), MAYBE(ReadOnly), 'attribute', MAYBE(ExtAttrs),
+          Type, Id, MAYBE(_AttrRaises), ';'],
         # FremontCut:
         [MAYBE(_Annotations), MAYBE(ExtAttrs),
          MAYBE(_AttrGetterSetter), MAYBE(Stringifier), MAYBE(ReadOnly),
diff --git a/lib/html/scripts/systemhtml.py b/lib/html/scripts/systemhtml.py
index 26fd788..56182c1 100644
--- a/lib/html/scripts/systemhtml.py
+++ b/lib/html/scripts/systemhtml.py
@@ -82,8 +82,9 @@
     info.constructor_name = self.name
     info.js_name = None
     info.type_name = interface_name
-    info.param_infos = map(lambda tXn: ParamInfo(tXn[1], None, tXn[0], 'null'),
+    info.param_infos = map(lambda tXn: ParamInfo(tXn[1], tXn[0], True),
                            self.opt_params)
+    info.requires_named_arguments = True
     return info
 
 _html_element_constructors = {
@@ -185,7 +186,8 @@
         CONSTRUCTOR=constructor_info.ConstructorFactoryName(rename_type),
         CLASS=class_name,
         TAG=info.tag,
-        PARAMS=constructor_info.ParametersInterfaceDeclaration(rename_type))
+        PARAMS=constructor_info.ParametersDeclaration(
+            rename_type, force_optional=True))
     for param in constructor_info.param_infos:
       inits.Emit('    if ($E != null) _e.$E = $E;\n', E=param.name)
 
@@ -205,7 +207,6 @@
     self._interface = interface
     self._backend = backend
     self._interface_type_info = self._type_registry.TypeInfo(self._interface.id)
-    self._html_interface_name = options.renamer.RenameInterface(self._interface)
 
   def Generate(self):
     if 'Callback' in self._interface.ext_attrs:
@@ -220,26 +221,24 @@
     info = AnalyzeOperation(self._interface, handlers)
     code = self._library_emitter.FileEmitter(self._interface.id)
     code.Emit(self._template_loader.Load('callback.darttemplate'))
-    code.Emit('typedef $TYPE $NAME($PARAMS);\n',
+    code.Emit('typedef void $NAME($PARAMS);\n',
               NAME=self._interface.id,
-              TYPE=self._DartType(info.type_name),
-              PARAMS=info.ParametersImplementationDeclaration(self._DartType))
+              PARAMS=info.ParametersDeclaration(self._DartType))
     self._backend.GenerateCallback(info)
 
   def GenerateInterface(self):
+    interface_name = self._interface_type_info.interface_name()
+
     if (self._interface_type_info.has_generated_interface() and
         not self._interface_type_info.merged_into()):
-      interface_emitter = self._library_emitter.FileEmitter(
-          self._html_interface_name)
+      interface_emitter = self._library_emitter.FileEmitter(interface_name)
     else:
       interface_emitter = emitter.Emitter()
 
-    template_file = 'interface_%s.darttemplate' % self._html_interface_name
+    template_file = 'interface_%s.darttemplate' % interface_name
     interface_template = (self._template_loader.TryLoad(template_file) or
                           self._template_loader.Load('interface.darttemplate'))
 
-    typename = self._html_interface_name
-
     implements = []
     suppressed_implements = []
 
@@ -258,8 +257,8 @@
         suppressed_implements.append('%s.%s' %
             (self._common_prefix, parent_interface_name))
 
-    if typename in _secure_base_types:
-      implements.append(_secure_base_types[typename])
+    if interface_name in _secure_base_types:
+      implements.append(_secure_base_types[interface_name])
 
     comment = ' extends'
     implements_str = ''
@@ -271,20 +270,20 @@
           ', '.join(suppressed_implements))
 
     factory_provider = None
-    if typename in interface_factories:
-      factory_provider = interface_factories[typename]
+    if interface_name in interface_factories:
+      factory_provider = interface_factories[interface_name]
 
     constructors = []
     constructor_info = AnalyzeConstructor(self._interface)
     if constructor_info:
       constructors.append(constructor_info)
-      factory_provider = '_' + typename + 'FactoryProvider'
+      factory_provider = '_' + interface_name + 'FactoryProvider'
       factory_provider_emitter = self._library_emitter.FileEmitter(
-          '_%sFactoryProvider' % self._html_interface_name)
+          '_%sFactoryProvider' % interface_name)
       self._backend.EmitFactoryProvider(
           constructor_info, factory_provider, factory_provider_emitter)
 
-    infos = HtmlElementConstructorInfos(typename)
+    infos = HtmlElementConstructorInfos(interface_name)
     if infos:
       template = self._template_loader.Load(
           'factoryprovider_Elements.darttemplate')
@@ -292,7 +291,7 @@
           self._library_emitter.FileEmitter('_Elements', template),
           infos,
           self._interface.id,
-          self._backend.ImplementationClassName(),
+          self._interface_type_info.implementation_name(),
           self._DartType)
 
     for info in infos:
@@ -307,20 +306,28 @@
      self._members_emitter,
      self._top_level_emitter) = interface_emitter.Emit(
          interface_template + '$!TOP_LEVEL',
-         ID=typename,
+         ID=interface_name,
          EXTENDS=implements_str)
 
     self._type_comment_emitter.Emit("/// @domName $DOMNAME",
         DOMNAME=self._interface.doc_js_name)
 
     implementation_emitter = self._ImplementationEmitter()
-    base_class = self._backend.BaseClassName()
-    interface_type_info = self._type_registry.TypeInfo(self._interface.id)
-    implemented_interfaces = [interface_type_info.interface_name()] +\
+
+    base_class = self._backend.RootClassName()
+    if self._interface.parents:
+      supertype = self._interface.parents[0].type.id
+      if not IsDartCollectionType(supertype) and not IsPureInterface(supertype):
+        type_info = self._type_registry.TypeInfo(supertype)
+        if type_info.merged_into() and self._backend.ImplementsMergedMembers():
+          type_info = self._type_registry.TypeInfo(type_info.merged_into())
+        base_class = type_info.implementation_name()
+
+    implemented_interfaces = [interface_name] +\
                              self._backend.AdditionalImplementedInterfaces()
     self._implementation_members_emitter = implementation_emitter.Emit(
         self._backend.ImplementationTemplate(),
-        CLASSNAME=self._backend.ImplementationClassName(),
+        CLASSNAME=self._interface_type_info.implementation_name(),
         EXTENDS=' extends %s' % base_class if base_class else '',
         IMPLEMENTS=' implements ' + ', '.join(implemented_interfaces),
         NATIVESPEC=self._backend.NativeSpec())
@@ -348,7 +355,7 @@
         FACTORY=factory_provider)
 
     events_interface = self._event_generator.ProcessInterface(
-        self._interface, self._html_interface_name,
+        self._interface, interface_name,
         self._backend.CustomJSMembers(),
         interface_emitter, implementation_emitter)
     if events_interface:
@@ -484,16 +491,18 @@
 
       if info.IsStatic():
         # FIXME: provide a type.
-        self._members_emitter.Emit('\n'
-                                  '  static final $NAME = $IMPL_CLASS_NAME.$NAME;\n',
-                                  IMPL_CLASS_NAME=self._backend.ImplementationClassName(),
-                                  NAME=html_name)
+        self._members_emitter.Emit(
+            '\n'
+            '  static final $NAME = $IMPL_CLASS_NAME.$NAME;\n',
+            IMPL_CLASS_NAME=self._interface_type_info.implementation_name(),
+            NAME=html_name)
       else:
-        self._members_emitter.Emit('\n'
-                                  '  $TYPE $NAME($PARAMS);\n',
-                                  TYPE=SecureOutputType(self, info.type_name),
-                                  NAME=html_name,
-                                  PARAMS=info.ParametersInterfaceDeclaration(self._DartType))
+        self._members_emitter.Emit(
+             '\n'
+             '  $TYPE $NAME($PARAMS);\n',
+             TYPE=SecureOutputType(self, info.type_name),
+             NAME=html_name,
+             PARAMS=info.ParametersDeclaration(self._DartType))
     self._backend.AddOperation(info, html_name)
 
   def AddSecondaryOperation(self, interface, info):
@@ -510,16 +519,12 @@
   def _ImplementationEmitter(self):
     if IsPureInterface(self._interface.id):
       return emitter.Emitter()
-
-    if not self._interface_type_info.merged_into():
-      name = self._html_interface_name
-      basename = '%sImpl' % name
-    else:
-      if self._backend.ImplementsMergedMembers():
-        # Merged members are implemented in target interface implementation.
-        return emitter.Emitter()
-      basename = '%sImpl_Merged' % self._html_interface_name
-    return self._library_emitter.FileEmitter(basename)
+    basename = self._interface_type_info.implementation_name()
+    if (self._interface_type_info.merged_into() and
+        self._backend.ImplementsMergedMembers()):
+      # Merged members are implemented in target interface implementation.
+      return emitter.Emitter()
+    return self._library_emitter.FileEmitter(basename.lstrip('_'))
 
   def _EmitEventGetter(self, events_interface, events_class):
     self._members_emitter.Emit(
@@ -587,31 +592,16 @@
     self._template_loader = options.templates
     self._type_registry = options.type_registry
     self._interface_type_info = self._type_registry.TypeInfo(self._interface.id)
-    self._html_interface_name = options.renamer.RenameInterface(self._interface)
     self._current_secondary_parent = None
 
-  def ImplementationClassName(self):
-    return self._ImplClassName(self._html_interface_name)
-
   def ImplementsMergedMembers(self):
     return True
 
-  def _ImplClassName(self, type_name):
-    return '_%sImpl' % type_name
-
   def GenerateCallback(self, info):
     pass
 
-  def BaseClassName(self):
-    if not self._interface.parents:
-      return None
-    supertype = self._interface.parents[0].type.id
-    if IsDartCollectionType(supertype):
-      # List methods are injected in AddIndexer.
-      return None
-    if IsPureInterface(supertype):
-      return None
-    return self._type_registry.TypeInfo(supertype).implementation_name()
+  def RootClassName(self):
+    return None
 
   def AdditionalImplementedInterfaces(self):
     # TODO: Include all implemented interfaces, including other Lists.
@@ -628,7 +618,8 @@
     return ' native "%s"' % native_spec
 
   def ImplementationTemplate(self):
-    template_file = 'impl_%s.darttemplate' % self._html_interface_name
+    template_file = ('impl_%s.darttemplate' %
+                     self._interface_type_info.interface_name())
     return (self._template_loader.TryLoad(template_file) or
             self._template_loader.Load('dart2js_impl.darttemplate'))
 
@@ -640,18 +631,23 @@
 
   def EmitFactoryProvider(self, constructor_info, factory_provider, emitter):
     template_file = ('factoryprovider_%s.darttemplate' %
-                     self._html_interface_name)
+                     self._interface_type_info.interface_name())
     template = self._template_loader.TryLoad(template_file)
     if not template:
       template = self._template_loader.Load('factoryprovider.darttemplate')
 
+    interface_name = self._interface_type_info.interface_name()
+    arguments = constructor_info.ParametersAsArgumentList()
+    comma = ',' if arguments else ''
     emitter.Emit(
         template,
         FACTORYPROVIDER=factory_provider,
-        CONSTRUCTOR=self._html_interface_name,
-        PARAMETERS=constructor_info.ParametersImplementationDeclaration(self._DartType),
-        NAMED_CONSTRUCTOR=constructor_info.name or self._html_interface_name,
-        ARGUMENTS=constructor_info.ParametersAsArgumentList())
+        CONSTRUCTOR=interface_name,
+        PARAMETERS=constructor_info.ParametersDeclaration(self._DartType),
+        NAMED_CONSTRUCTOR=constructor_info.name or interface_name,
+        ARGUMENTS=arguments,
+        PRE_ARGUMENTS_COMMA=comma,
+        ARGUMENTS_PATTERN=','.join(['#'] * len(constructor_info.param_infos)))
 
   def SecondaryContext(self, interface):
     if interface is not self._current_secondary_parent:
@@ -679,13 +675,14 @@
     #
     self._members_emitter.Emit(
         '\n'
-        '  $TYPE operator[](int index) native "return this[index];";\n',
+        '  $TYPE operator[](int index) => JS("$TYPE", "#[#]", this, index);\n',
         TYPE=self._NarrowOutputType(element_type))
 
     if 'CustomIndexedSetter' in self._interface.ext_attrs:
       self._members_emitter.Emit(
           '\n'
-          '  void operator[]=(int index, $TYPE value) native "this[index] = value";\n',
+          '  void operator[]=(int index, $TYPE value) =>'
+          ' JS("void", "#[#] = #", this, index, value);\n',
           TYPE=self._NarrowInputType(element_type))
     else:
       # The HTML library implementation of NodeList has a custom indexed setter
@@ -703,7 +700,10 @@
     # TODO(sra): Use separate mixins for typed array implementations of List<T>.
     if self._interface.id != 'NodeList':
       template_file = 'immutable_list_mixin.darttemplate'
-      template = self._template_loader.Load(template_file)
+      has_contains = any(op.id == 'contains' for op in self._interface.operations)
+      template = self._template_loader.Load(
+          template_file,
+          {'DEFINE_CONTAINS': not has_contains})
       self._members_emitter.Emit(template, E=self._DartType(element_type))
 
   def AddAttribute(self, attribute, html_name, read_only):
@@ -750,12 +750,14 @@
     input_type = self._NarrowInputType(attribute.type.id)
     if not read_only:
       self._members_emitter.Emit(
-          '\n  $TYPE $NAME;\n',
+          '\n  $TYPE $NAME;'
+          '\n',
           NAME=DartDomNameOfAttribute(attribute),
           TYPE=output_type)
     else:
       self._members_emitter.Emit(
-          '\n  final $TYPE $NAME;\n',
+          '\n  final $TYPE $NAME;'
+          '\n',
           NAME=DartDomNameOfAttribute(attribute),
           TYPE=output_type)
 
@@ -770,7 +772,9 @@
       return self._AddConvertingGetter(attr, html_name, conversion)
     return_type = self._NarrowOutputType(attr.type.id)
     self._members_emitter.Emit(
-        '\n  $TYPE get $HTML_NAME() native "return this.$NAME;";\n',
+        # TODO(sra): Use metadata to provide native name.
+        '\n  $TYPE get $HTML_NAME() => JS("$TYPE", "#.$NAME", this);'
+        '\n',
         HTML_NAME=html_name,
         NAME=attr.id,
         TYPE=return_type)
@@ -780,16 +784,21 @@
     if conversion:
       return self._AddConvertingSetter(attr, html_name, conversion)
     self._members_emitter.Emit(
-        '\n  void set $HTML_NAME($TYPE value)'
-        ' native "this.$NAME = value;";\n',
+        # TODO(sra): Use metadata to provide native name.
+        '\n  void set $HTML_NAME($TYPE value) {'
+        '\n    JS("void", "#.$NAME = #", this, value);'
+        '\n  }'
+        '\n',
         HTML_NAME=html_name,
         NAME=attr.id,
         TYPE=self._NarrowInputType(attr.type.id))
 
   def _AddConvertingGetter(self, attr, html_name, conversion):
     self._members_emitter.Emit(
+        # TODO(sra): Use metadata to provide native name.
         '\n  $RETURN_TYPE get $HTML_NAME => $CONVERT(this._$(HTML_NAME));'
-        '\n  $NATIVE_TYPE get _$HTML_NAME() native "return this.$NAME;";'
+        '\n  $NATIVE_TYPE get _$HTML_NAME() =>'
+        ' JS("$NATIVE_TYPE", "#.$NAME", this);'
         '\n',
         CONVERT=conversion.function_name,
         HTML_NAME=html_name,
@@ -799,10 +808,13 @@
 
   def _AddConvertingSetter(self, attr, html_name, conversion):
     self._members_emitter.Emit(
+        # TODO(sra): Use metadata to provide native name.
         '\n  void set $HTML_NAME($INPUT_TYPE value) {'
-        ' this._$HTML_NAME = $CONVERT(value); }'
-        '\n  void set _$HTML_NAME(/*$NATIVE_TYPE*/ value)'
-        ' native "this.$NAME = value;";'
+        '\n    this._$HTML_NAME = $CONVERT(value);'
+        '\n  }'
+        '\n  void set _$HTML_NAME(/*$NATIVE_TYPE*/ value) {'
+        '\n    JS("void", "#.$NAME = #", this, value);'
+        '\n  }'
         '\n',
         CONVERT=conversion.function_name,
         HTML_NAME=html_name,
@@ -837,8 +849,7 @@
           TYPE=return_type,
           HTML_NAME=html_name,
           NAME=info.declared_name,
-          PARAMS=info.ParametersImplementationDeclaration(
-              lambda type_name: self._NarrowInputType(type_name)))
+          PARAMS=info.ParametersDeclaration(self._NarrowInputType))
 
       operation_emitter.Emit(
           '\n'
@@ -851,8 +862,7 @@
           MODIFIERS='static ' if info.IsStatic() else '',
           TYPE=self._NarrowOutputType(info.type_name),
           NAME=info.name,
-          PARAMS=info.ParametersImplementationDeclaration(
-              lambda type_name: self._NarrowInputType(type_name)))
+          PARAMS=info.ParametersDeclaration(self._NarrowInputType))
 
   def _AddOperationWithConversions(self, info, html_name):
     # Assert all operations have same return type.
@@ -872,7 +882,7 @@
       if conversion:
         return conversion.input_type
       else:
-        return self._NarrowInputType(type_name)
+        return self._NarrowInputType(type_name) if type_name else 'Dynamic'
 
     body = self._members_emitter.Emit(
         '\n'
@@ -882,10 +892,10 @@
         MODIFIERS='static ' if info.IsStatic() else '',
         TYPE=return_type,
         HTML_NAME=html_name,
-        PARAMS=info.ParametersImplementationDeclaration(InputType))
+        PARAMS=info.ParametersDeclaration(InputType))
 
     parameter_names = [param_info.name for param_info in info.param_infos]
-    parameter_types = [InputType(param_info.dart_type)
+    parameter_types = [InputType(param_info.type_id)
                        for param_info in info.param_infos]
     operations = info.operations
 
@@ -926,7 +936,7 @@
           arguments.append(parameter_names[position])
           param_type = self._NarrowInputType(arg.type.id)
           # Verified by argument checking on entry to the dispatcher.
-          verified_type = InputType(info.param_infos[position].dart_type)
+          verified_type = InputType(info.param_infos[position].type_id)
 
         # The native method does not need an argument type if we know the type.
         # But we do need the native methods to have correct function types, so
@@ -1018,7 +1028,8 @@
     return FindConversion(idl_type, 'set', self._interface.id, member)
 
   def _HasCustomImplementation(self, member_name):
-    member_name = '%s.%s' % (self._html_interface_name, member_name)
+    member_name = '%s.%s' % (self._interface_type_info.interface_name(),
+                             member_name)
     return member_name in _js_custom_members
 
   def CustomJSMembers(self):
@@ -1032,8 +1043,6 @@
     return False
 
   def _NarrowToImplementationType(self, type_name):
-    if type_name == 'Dynamic':
-      return type_name
     return self._type_registry.TypeInfo(type_name).narrow_dart_type()
 
   def _NarrowInputType(self, type_name):
diff --git a/lib/html/scripts/systemnative.py b/lib/html/scripts/systemnative.py
index 187a272..125ee4c 100644
--- a/lib/html/scripts/systemnative.py
+++ b/lib/html/scripts/systemnative.py
@@ -20,10 +20,7 @@
     self._database = options.database
     self._template_loader = options.templates
     self._type_registry = options.type_registry
-    self._html_interface_name = options.renamer.RenameInterface(self._interface)
-
-  def ImplementationClassName(self):
-    return self._ImplClassName(self._interface.id)
+    self._interface_type_info = self._type_registry.TypeInfo(self._interface.id)
 
   def ImplementsMergedMembers(self):
     # We could not add merged functions to implementation class because
@@ -96,13 +93,17 @@
 
   def ImplementationTemplate(self):
     template = None
-    if self._html_interface_name == self._interface.id or not self._database.HasInterface(self._html_interface_name):
-      template_file = 'impl_%s.darttemplate' % self._html_interface_name
+    interface_name = self._interface_type_info.interface_name()
+    if interface_name == self._interface.id or not self._database.HasInterface(interface_name):
+      template_file = 'impl_%s.darttemplate' % interface_name
       template = self._template_loader.TryLoad(template_file)
     if not template:
       template = self._template_loader.Load('dart_implementation.darttemplate')
     return template
 
+  def RootClassName(self):
+    return 'NativeFieldWrapperClass1'
+
   def AdditionalImplementedInterfaces(self):
     return []
 
@@ -174,30 +175,6 @@
         self._interface.id,
         'ConstructorRaisesException' in ext_attrs)
 
-  def _ImplClassName(self, interface_name):
-    return '_%sImpl' % interface_name
-
-  def BaseClassName(self):
-    root_class = 'NativeFieldWrapperClass1'
-
-    if not self._interface.parents:
-      return root_class
-
-    supertype = self._interface.parents[0].type.id
-
-    if IsPureInterface(supertype):    # The class is a root.
-      return root_class
-
-    # FIXME: We're currently injecting List<..> and EventTarget as
-    # supertypes in dart.idl. We should annotate/preserve as
-    # attributes instead.  For now, this hack lets the self._interfaces
-    # inherit, but not the classes.
-    # List methods are injected in AddIndexer.
-    if IsDartListType(supertype) or IsDartCollectionType(supertype):
-      return root_class
-
-    return self._ImplClassName(supertype)
-
   ATTRIBUTES_OF_CONSTRUCTABLE = set([
     'CustomConstructor',
     'V8CustomConstructor',
@@ -217,7 +194,8 @@
     return False
 
   def EmitFactoryProvider(self, constructor_info, factory_provider, emitter):
-    template_file = 'factoryprovider_%s.darttemplate' % self._html_interface_name
+    interface_name = self._interface_type_info.interface_name()
+    template_file = 'factoryprovider_%s.darttemplate' % interface_name
     template = self._template_loader.TryLoad(template_file)
     if not template:
       template = self._template_loader.Load('factoryprovider.darttemplate')
@@ -226,8 +204,8 @@
     emitter.Emit(
         template,
         FACTORYPROVIDER=factory_provider,
-        INTERFACE=self._html_interface_name,
-        PARAMETERS=constructor_info.ParametersImplementationDeclaration(self._DartType),
+        INTERFACE=interface_name,
+        PARAMETERS=constructor_info.ParametersDeclaration(self._DartType),
         ARGUMENTS=constructor_info.ParametersAsArgumentList(),
         NATIVE_NAME=native_binding)
 
@@ -240,7 +218,7 @@
         INCLUDES=self._GenerateCPPIncludes(self._cpp_impl_includes),
         CALLBACKS=self._cpp_definitions_emitter.Fragments(),
         RESOLVER=self._cpp_resolver_emitter.Fragments(),
-        DART_IMPLEMENTATION_CLASS=self.ImplementationClassName())
+        DART_IMPLEMENTATION_CLASS=self._interface_type_info.implementation_name())
 
   def _GenerateCPPHeader(self):
     to_native_emitter = emitter.Emitter()
@@ -420,7 +398,10 @@
     # TODO(sra): Use separate mixins for mutable implementations of List<T>.
     # TODO(sra): Use separate mixins for typed array implementations of List<T>.
     template_file = 'immutable_list_mixin.darttemplate'
-    template = self._template_loader.Load(template_file)
+    has_contains = any(op.id == 'contains' for op in self._interface.operations)
+    template = self._template_loader.Load(
+        template_file,
+        {'DEFINE_CONTAINS': not has_contains})
     self._members_emitter.Emit(template, E=dart_element_type)
 
   def AmendIndexer(self, element_type):
@@ -476,7 +457,7 @@
         'static ' if info.IsStatic() else '',
         SecureOutputType(self, info.type_name),
         html_name,
-        info.ParametersImplementationDeclaration(
+        info.ParametersDeclaration(
             (lambda x: 'Dynamic') if needs_dispatcher else self._DartType))
 
     if not needs_dispatcher:
diff --git a/lib/html/scripts/templateloader.py b/lib/html/scripts/templateloader.py
index 3c95071..647362b 100644
--- a/lib/html/scripts/templateloader.py
+++ b/lib/html/scripts/templateloader.py
@@ -33,30 +33,32 @@
     self._conditions = conditions
     self._cache = {}
 
-  def TryLoad(self, name):
+  def TryLoad(self, name, more_conditions={}):
     """Returns content of template file as a string, or None of not found."""
-    if name in self._cache:
-      return self._cache[name]
+    conditions = dict(self._conditions, **more_conditions)
+    cache_key = (name, tuple(sorted(conditions.items())))
+    if cache_key in self._cache:
+      return self._cache[cache_key]
 
     for subpath in self._subpaths:
       template_file = os.path.join(self._root, subpath, name)
       if os.path.exists(template_file):
         template = ''.join(open(template_file).readlines())
-        template = self._Preprocess(template, template_file)
-        self._cache[name] = template
+        template = self._Preprocess(template, template_file, conditions)
+        self._cache[cache_key] = template
         return template
 
     return None
 
-  def Load(self, name):
+  def Load(self, name, more_conditions={}):
     """Returns contents of template file as a string, or raises an exception."""
-    template = self.TryLoad(name)
+    template = self.TryLoad(name, more_conditions)
     if template is not None:  # Can be empty string
       return template
     raise Exception("Could not find template '%s' on %s / %s" % (
         name, self._root, self._subpaths))
 
-  def _Preprocess(self, template, filename):
+  def _Preprocess(self, template, filename, conditions):
     def error(lineno, message):
       raise Exception('%s:%s: %s' % (filename, lineno, message))
 
@@ -78,9 +80,9 @@
           if len(words) != 2:
             error(lineno, '$if does not have single variable')
           variable = words[1]
-          if variable in self._conditions:
+          if variable in conditions:
             condition_stack.append((active, seen_else))
-            active = self._conditions[variable]
+            active = conditions[variable]
             seen_else = False
           else:
             error(lineno, "Unknown $if variable '%s'" % variable)
diff --git a/lib/html/src/Measurement.dart b/lib/html/src/Measurement.dart
index e69342f..54eed3e 100644
--- a/lib/html/src/Measurement.dart
+++ b/lib/html/src/Measurement.dart
@@ -99,7 +99,7 @@
     // so we just make a dummy event and listen for that.
     _observer = new MutationObserver(this._handleMutation);
     _dummy = new DivElement();
-    _observer.observe(_dummy, {}, attributes: true);
+    _observer.observe(_dummy, attributes: true);
   }
 
   void _schedule() {
diff --git a/lib/html/src/_Collections.dart b/lib/html/src/_Collections.dart
index 785e669..9096fc6 100644
--- a/lib/html/src/_Collections.dart
+++ b/lib/html/src/_Collections.dart
@@ -8,6 +8,13 @@
  * method.
  */
 class _Collections {
+  static bool contains(Iterable<Object> iterable, Object element) {
+    for (final e in iterable) {
+      if (e == element) return true;
+    }
+    return false;
+  }
+
   static void forEach(Iterable<Object> iterable, void f(Object o)) {
     for (final e in iterable) {
       f(e);
diff --git a/lib/html/src/dart2js_FactoryProviders.dart b/lib/html/src/dart2js_FactoryProviders.dart
index d17e0f0..51e0f12 100644
--- a/lib/html/src/dart2js_FactoryProviders.dart
+++ b/lib/html/src/dart2js_FactoryProviders.dart
@@ -4,23 +4,23 @@
 
 class _AudioContextFactoryProvider {
 
-  static AudioContext createAudioContext() native '''
-    var constructor = window.AudioContext || window.webkitAudioContext;
-    return new constructor();
-''';
+  static AudioContext createAudioContext() {
+    return JS('AudioContext',
+              'new (window.AudioContext || window.webkitAudioContext)()');
+  }
 }
 
 class _PointFactoryProvider {
-  static Point createPoint(num x, num y) native
-    'return new WebKitPoint(x, y);';
+  static Point createPoint(num x, num y) =>
+      JS('Point', 'new WebKitPoint(#, #)', x, y);
 }
 
 class _WebSocketFactoryProvider {
-  static WebSocket createWebSocket(String url) native
-      '''return new WebSocket(url);''';
+  static WebSocket createWebSocket(String url) =>
+      JS('WebSocket', 'new WebSocket(#)', url);
 }
 
 class _TextFactoryProvider {
-  static Text createText(String data) native
-      "return document.createTextNode(data);";
+  static Text createText(String data) =>
+      JS('Text', 'document.createTextNode(#)', data);
 }
diff --git a/lib/html/src/dart2js_IDBKeyRangeFactoryProvider.dart b/lib/html/src/dart2js_IDBKeyRangeFactoryProvider.dart
index 61b271f..71e9e38 100644
--- a/lib/html/src/dart2js_IDBKeyRangeFactoryProvider.dart
+++ b/lib/html/src/dart2js_IDBKeyRangeFactoryProvider.dart
@@ -27,23 +27,23 @@
     return _cachedClass = _uncachedClass();
   }
 
-  static _uncachedClass() native '''
-      return window.webkitIDBKeyRange || window.mozIDBKeyRange ||
-             window.msIDBKeyRange || window.IDBKeyRange;
-  ''';
+  static _uncachedClass() =>
+    JS('var',
+       '''window.webkitIDBKeyRange || window.mozIDBKeyRange ||
+          window.msIDBKeyRange || window.IDBKeyRange''');
 
   static _translateKey(idbkey) => idbkey;  // TODO: fixme.
 
-  static _IDBKeyRangeImpl _only(cls, value) native
-      '''return cls.only(value);''';
+  static _IDBKeyRangeImpl _only(cls, value) =>
+       JS('_IDBKeyRangeImpl', '#.only(#)', cls, value);
 
-  static _IDBKeyRangeImpl _lowerBound(cls, bound, open) native
-      '''return cls.lowerBound(bound, open);''';
+  static _IDBKeyRangeImpl _lowerBound(cls, bound, open) =>
+       JS('_IDBKeyRangeImpl', '#.lowerBound(#, #)', cls, bound, open);
 
-  static _IDBKeyRangeImpl _upperBound(cls, bound, open) native
-      '''return cls.upperBound(bound, open);''';
+  static _IDBKeyRangeImpl _upperBound(cls, bound, open) =>
+       JS('_IDBKeyRangeImpl', '#.upperBound(#, #)', cls, bound, open);
 
-  static _IDBKeyRangeImpl _bound(cls, lower, upper, lowerOpen, upperOpen) native
-      '''return cls.bound(lower, upper, lowerOpen, upperOpen);''';
-
+  static _IDBKeyRangeImpl _bound(cls, lower, upper, lowerOpen, upperOpen) =>
+       JS('_IDBKeyRangeImpl', '#.bound(#, #, #, #)',
+          cls, lower, upper, lowerOpen, upperOpen);
 }
diff --git a/lib/html/src/dart2js_LocationWrapper.dart b/lib/html/src/dart2js_LocationWrapper.dart
index e6433d6..6401a6d 100644
--- a/lib/html/src/dart2js_LocationWrapper.dart
+++ b/lib/html/src/dart2js_LocationWrapper.dart
@@ -54,20 +54,15 @@
   void set search(String value) => _set(_ptr, 'search', value);
 
 
-  void assign(String url) => _assign(_ptr, url);
+  void assign(String url) => JS('void', '#.assign(#)', _ptr, url);
 
-  void reload() => _reload(_ptr);
+  void reload() => JS('void', '#.reload()', _ptr);
 
-  void replace(String url) => _replace(_ptr, url);
+  void replace(String url) => JS('void', '#.replace(#)', _ptr, url);
 
-  String toString() => _toString(_ptr);
+  String toString() => JS('String', '#.toString()', _ptr);
 
 
-  static _get(p, m) native 'return p[m];';
-  static _set(p, m, v) native 'p[m] = v;';
-
-  static _assign(p, url) native 'p.assign(url);';
-  static _reload(p) native 'p.reload()';
-  static _replace(p, url) native 'p.replace(url);';
-  static _toString(p) native 'return p.toString();';
+  static _get(p, m) => JS('var', '#[#]', p, m);
+  static _set(p, m, v) => JS('void', '#[#] = #', p, m, v);
 }
diff --git a/lib/html/src/dart2js_MutationObserverSupported.dart b/lib/html/src/dart2js_MutationObserverSupported.dart
index f732907..2157df7 100644
--- a/lib/html/src/dart2js_MutationObserverSupported.dart
+++ b/lib/html/src/dart2js_MutationObserverSupported.dart
@@ -6,6 +6,5 @@
  * Checks to see if the mutation observer API is supported on the current
  * platform.
  */
-bool _isMutationObserverSupported() native '''
-  return !!( window.MutationObserver || window.WebKitMutationObserver);
-''';
+bool _isMutationObserverSupported() =>
+  JS('bool', '!!(window.MutationObserver || window.WebKitMutationObserver)');
diff --git a/lib/html/src/dart2js_TypedArrayFactoryProvider.dart b/lib/html/src/dart2js_TypedArrayFactoryProvider.dart
index 3b313a0..185a91e 100644
--- a/lib/html/src/dart2js_TypedArrayFactoryProvider.dart
+++ b/lib/html/src/dart2js_TypedArrayFactoryProvider.dart
@@ -85,35 +85,62 @@
     return _U8C_3(buffer, byteOffset, length);
   }
 
-  static Float32Array _F32(arg) native 'return new Float32Array(arg);';
-  static Float64Array _F64(arg) native 'return new Float64Array(arg);';
-  static Int8Array _I8(arg) native 'return new Int8Array(arg);';
-  static Int16Array _I16(arg) native 'return new Int16Array(arg);';
-  static Int32Array _I32(arg) native 'return new Int32Array(arg);';
-  static Uint8Array _U8(arg) native 'return new Uint8Array(arg);';
-  static Uint16Array _U16(arg) native 'return new Uint16Array(arg);';
-  static Uint32Array _U32(arg) native 'return new Uint32Array(arg);';
-  static Uint8ClampedArray _U8C(arg) native 'return new Uint8ClampedArray(arg);';
+  static Float32Array _F32(arg) =>
+      JS('Float32Array', 'new Float32Array(#)', arg);
+  static Float64Array _F64(arg) =>
+      JS('Float64Array', 'new Float64Array(#)', arg);
+  static Int8Array _I8(arg) =>
+      JS('Int8Array', 'new Int8Array(#)', arg);
+  static Int16Array _I16(arg) =>
+      JS('Int16Array', 'new Int16Array(#)', arg);
+  static Int32Array _I32(arg) =>
+      JS('Int32Array', 'new Int32Array(#)', arg);
+  static Uint8Array _U8(arg) =>
+      JS('Uint8Array', 'new Uint8Array(#)', arg);
+  static Uint16Array _U16(arg) =>
+      JS('Uint16Array', 'new Uint16Array(#)', arg);
+  static Uint32Array _U32(arg) =>
+      JS('Uint32Array', 'new Uint32Array(#)', arg);
+  static Uint8ClampedArray _U8C(arg) =>
+      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#)', arg);
 
-  static Float32Array _F32_2(arg1, arg2) native 'return new Float32Array(arg1, arg2);';
-  static Float64Array _F64_2(arg1, arg2) native 'return new Float64Array(arg1, arg2);';
-  static Int8Array _I8_2(arg1, arg2) native 'return new Int8Array(arg1, arg2);';
-  static Int16Array _I16_2(arg1, arg2) native 'return new Int16Array(arg1, arg2);';
-  static Int32Array _I32_2(arg1, arg2) native 'return new Int32Array(arg1, arg2);';
-  static Uint8Array _U8_2(arg1, arg2) native 'return new Uint8Array(arg1, arg2);';
-  static Uint16Array _U16_2(arg1, arg2) native 'return new Uint16Array(arg1, arg2);';
-  static Uint32Array _U32_2(arg1, arg2) native 'return new Uint32Array(arg1, arg2);';
-  static Uint8ClampedArray _U8C_2(arg1, arg2) native 'return new Uint8ClampedArray(arg1, arg2);';
+  static Float32Array _F32_2(arg1, arg2) =>
+      JS('Float32Array', 'new Float32Array(#, #)', arg1, arg2);
+  static Float64Array _F64_2(arg1, arg2) =>
+      JS('Float64Array', 'new Float64Array(#, #)', arg1, arg2);
+  static Int8Array _I8_2(arg1, arg2) =>
+      JS('Int8Array', 'new Int8Array(#, #)', arg1, arg2);
+  static Int16Array _I16_2(arg1, arg2) =>
+      JS('Int16Array', 'new Int16Array(#, #)', arg1, arg2);
+  static Int32Array _I32_2(arg1, arg2) =>
+      JS('Int32Array', 'new Int32Array(#, #)', arg1, arg2);
+  static Uint8Array _U8_2(arg1, arg2) =>
+      JS('Uint8Array', 'new Uint8Array(#, #)', arg1, arg2);
+  static Uint16Array _U16_2(arg1, arg2) =>
+      JS('Uint16Array', 'new Uint16Array(#, #)', arg1, arg2);
+  static Uint32Array _U32_2(arg1, arg2) =>
+      JS('Uint32Array', 'new Uint32Array(#, #)', arg1, arg2);
+  static Uint8ClampedArray _U8C_2(arg1, arg2) =>
+      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #)', arg1, arg2);
 
-  static Float32Array _F32_3(arg1, arg2, arg3) native 'return new Float32Array(arg1, arg2, arg3);';
-  static Float64Array _F64_3(arg1, arg2, arg3) native 'return new Float64Array(arg1, arg2, arg3);';
-  static Int8Array _I8_3(arg1, arg2, arg3) native 'return new Int8Array(arg1, arg2, arg3);';
-  static Int16Array _I16_3(arg1, arg2, arg3) native 'return new Int16Array(arg1, arg2, arg3);';
-  static Int32Array _I32_3(arg1, arg2, arg3) native 'return new Int32Array(arg1, arg2, arg3);';
-  static Uint8Array _U8_3(arg1, arg2, arg3) native 'return new Uint8Array(arg1, arg2, arg3);';
-  static Uint16Array _U16_3(arg1, arg2, arg3) native 'return new Uint16Array(arg1, arg2, arg3);';
-  static Uint32Array _U32_3(arg1, arg2, arg3) native 'return new Uint32Array(arg1, arg2, arg3);';
-  static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) native 'return new Uint8ClampedArray(arg1, arg2, arg3);';
+  static Float32Array _F32_3(arg1, arg2, arg3) =>
+      JS('Float32Array', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
+  static Float64Array _F64_3(arg1, arg2, arg3) =>
+      JS('Float64Array', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
+  static Int8Array _I8_3(arg1, arg2, arg3) =>
+      JS('Int8Array', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
+  static Int16Array _I16_3(arg1, arg2, arg3) =>
+      JS('Int16Array', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
+  static Int32Array _I32_3(arg1, arg2, arg3) =>
+      JS('Int32Array', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8Array _U8_3(arg1, arg2, arg3) =>
+      JS('Uint8Array', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
+  static Uint16Array _U16_3(arg1, arg2, arg3) =>
+      JS('Uint16Array', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
+  static Uint32Array _U32_3(arg1, arg2, arg3) =>
+      JS('Uint32Array', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
+  static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) =>
+      JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
 
 
   // Ensures that [list] is a JavaScript Array or a typed array.  If necessary,
diff --git a/lib/html/templates/html/dart2js/factoryprovider.darttemplate b/lib/html/templates/html/dart2js/factoryprovider.darttemplate
index 44892ef..bf8743d 100644
--- a/lib/html/templates/html/dart2js/factoryprovider.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider.darttemplate
@@ -3,6 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static $CONSTRUCTOR create$(CONSTRUCTOR)($PARAMETERS) native
-      '''return new $NAMED_CONSTRUCTOR($ARGUMENTS);''';
+  static $CONSTRUCTOR create$(CONSTRUCTOR)($PARAMETERS) =>
+      JS('$CONSTRUCTOR', 'new $NAMED_CONSTRUCTOR($ARGUMENTS_PATTERN)'$PRE_ARGUMENTS_COMMA $ARGUMENTS);
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_AudioElement.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_AudioElement.darttemplate
index e657b02..be657c3 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_AudioElement.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_AudioElement.darttemplate
@@ -3,8 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static AudioElement createAudioElement([String src = null]) native '''
-      if (src == null) return new Audio();
-      return new Audio(src);
-    ''';
+  static AudioElement createAudioElement([String src = null]) {
+    if (src == null) return JS('AudioElement', 'new Audio()');
+    return JS('AudioElement', 'new Audio(#)', src);
+  }
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_Blob.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_Blob.darttemplate
index f1d8630..886b77c 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_Blob.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_Blob.darttemplate
@@ -16,9 +16,9 @@
     return _create_2(blobParts, bag);
   }
 
-  static _create_1(parts) native 'return new Blob(parts);';
-  static _create_2(parts, bag) native 'return new Blob(parts, bag);';
+  static _create_1(parts) => JS('Blob', 'new Blob(#)', parts);
+  static _create_2(parts, bag) => JS('Blob', 'new Blob(#, #)', parts, bag);
 
-  static _create_bag() native 'return {}';
-  static _bag_set(bag, key, value) native 'bag[key] = value;';
+  static _create_bag() => JS('var', '{}');
+  static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_CSSMatrix.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_CSSMatrix.darttemplate
index 6abf326..261bd5c 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_CSSMatrix.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_CSSMatrix.darttemplate
@@ -3,6 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static CSSMatrix createCSSMatrix([String cssValue = '']) native
-      'return new WebKitCSSMatrix(cssValue);';
+  static CSSMatrix createCSSMatrix([String cssValue = '']) =>
+      JS('CSSMatrix', 'new WebKitCSSMatrix(#)', cssValue);
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
index c120b45..d903761 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_DataView.darttemplate
@@ -3,11 +3,14 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static DataView createDataView(ArrayBuffer buffer,
-      [int byteOffset = null, int byteLength = null])
-      native '''
-          if (byteOffset == null) return new DataView(buffer);
-          if (byteLength == null) return new DataView(buffer, byteOffset);
-          return new DataView(buffer, byteOffset, byteLength);
-      ''';
+  static DataView createDataView(
+      ArrayBuffer buffer, [int byteOffset = null, int byteLength = null]) {
+    if (byteOffset == null) {
+      return JS('DataView', 'new DataView(#)', buffer);
+    }
+    if (byteLength == null) {
+      return JS('DataView', 'new DataView(#,#)', buffer, byteOffset);
+    }
+    return JS('DataView', 'new DataView(#,#,#)', buffer, byteOffset, byteLength);
+  }
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_FormData.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_FormData.darttemplate
index bb0a9f1..b0e5c3a 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_FormData.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_FormData.darttemplate
@@ -3,8 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static FormData createFormData([FormElement form = null]) native '''
-    if (form == null) return new FormData();
-    return new FormData(form);
-  ''';
+  static FormData createFormData([FormElement form = null]) {
+    if (form == null) return JS('FormData', 'new FormData()');
+    return JS('FormData', 'new FormData(#)', form);
+  }
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_HttpRequest.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_HttpRequest.darttemplate
index e1f652b..1d35b61 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_HttpRequest.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_HttpRequest.darttemplate
@@ -3,7 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static HttpRequest createHttpRequest() native 'return new XMLHttpRequest();';
+  static HttpRequest createHttpRequest() =>
+      JS('HttpRequest', 'new XMLHttpRequest();');
 
   static HttpRequest createHttpRequest_get(String url,
       onSuccess(HttpRequest request)) =>
diff --git a/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
index 88d29d6..83ff8c9 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
@@ -9,4 +9,14 @@
         window.MozMutationObserver;
     return new constructor(callback);
   ''';
+
+  // TODO(sra): Dart2js inserts a conversion when a Dart function (i.e. an
+  // object with a call method) is passed to a native method.  This is so the
+  // native code sees a JavaScript function.
+  //
+  // This does not happen when a function is 'passed' to a JS-form so it is not
+  // possible to rewrite the above code to, e.g. (simplified):
+  //
+  // static createMutationObserver(MutationCallback callback) =>
+  //    JS('var', 'new (window.MutationObserver)(#)', callback);
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_OptionElement.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_OptionElement.darttemplate
index 0c8ce95..22769d8 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_OptionElement.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_OptionElement.darttemplate
@@ -4,12 +4,21 @@
 
 class $FACTORYPROVIDER {
   static OptionElement createOptionElement(
-      [String data, String value, bool defaultSelected, bool selected])
-      native '''
-          if (data == null) return new Option();
-          if (value == null) return new Option(data);
-          if (defaultSelected == null) return new Option(data, value);
-          if (selected == null) return new Option(data, value, defaultSelected);
-          return new Option(data, value, defaultSelected, selected);
-      ''';
+      [String data, String value, bool defaultSelected, bool selected]) {
+    if (data == null) {
+      return JS('OptionElement', 'new Option()');
+    }
+    if (value == null) {
+      return JS('OptionElement', 'new Option(#)', data);
+    }
+    if (defaultSelected == null) {
+      return JS('OptionElement', 'new Option(#,#)', data, value);
+    }
+    if (selected == null) {
+      return JS('OptionElement', 'new Option(#,#,#)',
+                data, value, defaultSelected);
+    }
+    return JS('OptionElement', 'new Option(#,#,#,#)',
+              data, value, defaultSelected, selected);
+  }
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_ShadowRoot.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_ShadowRoot.darttemplate
index c1f081e..7d82ab5 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_ShadowRoot.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_ShadowRoot.darttemplate
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static ShadowRoot createShadowRoot(Element host) native '''
-      return new (window.ShadowRoot || window.WebKitShadowRoot)(host);
-    ''';
+  static ShadowRoot createShadowRoot(Element host) =>
+      JS('ShadowRoot',
+         'new (window.ShadowRoot || window.WebKitShadowRoot)(#)', host);
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_SharedWorker.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_SharedWorker.darttemplate
index 157caae..bb3dcea 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_SharedWorker.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_SharedWorker.darttemplate
@@ -3,9 +3,8 @@
 // BSD-style license that can be found in the LICENSE file.
 
 class $FACTORYPROVIDER {
-  static SharedWorker createSharedWorker(String scriptURL, [String name])
-      native '''
-        if (name == null) return new SharedWorker(scriptURL);
-        return new SharedWorker(scriptURL, name);
-      ''';
+  static SharedWorker createSharedWorker(String scriptURL, [String name]) {
+    if (name == null) return JS('SharedWorker', 'new SharedWorker(#)', scriptURL);
+    return JS('SharedWorker', 'new SharedWorker(#,#)', scriptURL, name);
+  }
 }
diff --git a/lib/html/templates/html/dart2js/factoryprovider_TextTrackCue.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_TextTrackCue.darttemplate
index b69ac65..41b068d 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_TextTrackCue.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_TextTrackCue.darttemplate
@@ -5,12 +5,19 @@
 class $FACTORYPROVIDER {
   static TextTrackCue createTextTrackCue(
       String id, num startTime, num endTime, String text,
-      [String settings, bool pauseOnExit])
-      native '''
-        if (settings == null)
-          return new TextTrackCue(id, startTime, endTime, text);
-        if (pauseOnExit == null)
-          return new TextTrackCue(id, startTime, endTime, text, settings);
-        return new TextTrackCue(id, startTime, endTime, text, settings, pauseOnExit);
-      ''';
+      [String settings, bool pauseOnExit]) {
+        if (settings == null) {
+          return JS('TextTrackCue',
+                    'new TextTrackCue(#,#,#,#)',
+                    id, startTime, endTime, text);
+        }
+        if (pauseOnExit == null) {
+          return JS('TextTrackCue',
+                    'new TextTrackCue(#,#,#,#,#)',
+                    id, startTime, endTime, text, settings);
+        }
+        return JS('TextTrackCue',
+                  'new TextTrackCue(#,#,#,#,#,#)',
+                  id, startTime, endTime, text, settings, pauseOnExit);
+  }
 }
diff --git a/lib/html/templates/html/dart2js/html_dart2js.darttemplate b/lib/html/templates/html/dart2js/html_dart2js.darttemplate
index 9b10fb2..73036e9 100644
--- a/lib/html/templates/html/dart2js/html_dart2js.darttemplate
+++ b/lib/html/templates/html/dart2js/html_dart2js.darttemplate
@@ -37,12 +37,12 @@
 #source('$AUXILIARY_DIR/_Lists.dart');
 
 
-LocalWindow get window() native "return window;";
-_LocalWindowImpl get _window() native "return window;";
+LocalWindow get window() => JS('LocalWindow', 'window');
+_LocalWindowImpl get _window() => JS('_LocalWindowImpl', 'window');
 
-Document get document() native "return document;";
+Document get document() => JS('Document', 'document');
 
-_DocumentImpl get _document() native "return document;";
+_DocumentImpl get _document() => JS('_DocumentImpl', 'document');
 
 Element query(String selector) => _document.query(selector);
 List<Element> queryAll(String selector) => _document.queryAll(selector);
@@ -53,12 +53,12 @@
 }
 
 // Support for Send/ReceivePortSync.
-int _getNewIsolateId() native r'''
-  if (!window.$dart$isolate$counter) {
-    window.$dart$isolate$counter = 1;
+int _getNewIsolateId() {
+  if (JS('bool', r'!window.$dart$isolate$counter')) {
+    JS('void', r'window.$dart$isolate$counter = 1');
   }
-  return window.$dart$isolate$counter++;
-''';
+  return JS('int', r'window.$dart$isolate$counter++');
+}
 
 // Fast path to invoke JS send port.
 _callPortSync(int id, message) {
diff --git a/lib/html/templates/html/dart2js/impl_Console.darttemplate b/lib/html/templates/html/dart2js/impl_Console.darttemplate
index d0c0b5d..137f62a 100644
--- a/lib/html/templates/html/dart2js/impl_Console.darttemplate
+++ b/lib/html/templates/html/dart2js/impl_Console.darttemplate
@@ -4,7 +4,7 @@
 
 class $CLASSNAME
     // Console is sometimes a singleton bag-of-properties without a prototype.
-    implements Console 
+    implements Console
     native "=(typeof console == 'undefined' ? {} : console)" {
 $!MEMBERS
 }
diff --git a/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate b/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate
index 46b5c78..1817667 100644
--- a/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate
+++ b/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate
@@ -9,8 +9,8 @@
       throw new ArgumentError(mode);
     }
 
-    // TODO(sra): Ensure storeName_OR_storeNames is a string, List<String> or
-    // DOMStringList, and copy to JavaScript array if necessary.
+    // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
+    // and copy to JavaScript array if necessary.
 
     if (_transaction_fn != null) {
       return _transaction_fn(this, storeName_OR_storeNames, mode);
@@ -42,7 +42,8 @@
 
   _IDBTransactionImpl _transaction(stores, mode) native 'transaction';
 
-  static bool _hasNumericMode(txn) native 'return typeof(txn.mode) === "number"';
+  static bool _hasNumericMode(txn) =>
+      JS('bool', 'typeof(#.mode) === "number"', txn);
 
 $!MEMBERS}
 
diff --git a/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate b/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate
index e4cc282..54bf809 100644
--- a/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate
+++ b/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate
@@ -4,11 +4,12 @@
 
 class $CLASSNAME$EXTENDS$IMPLEMENTS native "@*DOMWindow" {
 
-  _DocumentImpl get document() native "return this.document;";
+  _DocumentImpl get document() => JS('_DocumentImpl', '#.document', this);
 
-  Window _open2(url, name) native "return this.open(url, name);";
+  Window _open2(url, name) => JS('Window', '#.open(#,#)', this, url, name);
 
-  Window _open3(url, name, options) native "return this.open(url, name, options);";
+  Window _open3(url, name, options) =>
+      JS('Window', '#.open(#,#,#)', this, url, name, options);
 
   Window open(String url, String name, [String options]) {
     if (options == null) {
@@ -53,8 +54,10 @@
   var _location_wrapper;  // Cached wrapped Location object.
 
   // Native getter and setter to access raw Location object.
-  Location get _location() native 'return this.location';
-  void set _location(Location value) native 'this.location = value';
+  Location get _location() => JS('Location', '#.location', this);
+  void set _location(Location value) {
+    JS('void', '#.location = #', this, value);
+  }
   // Prevent compiled from thinking 'location' property is available for a Dart
   // member.
   _protect_location() native 'location';
@@ -91,29 +94,39 @@
   void _cancelAnimationFrame(int id)
       native 'cancelAnimationFrame';
 
-  _ensureRequestAnimationFrame() native '''
-   if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
+  _ensureRequestAnimationFrame() {
+    if (JS('bool',
+           '!!(#.requestAnimationFrame && #.cancelAnimationFrame)', this, this))
+      return;
+
+    JS('void',
+       r"""
+  (function($this) {
    var vendors = ['ms', 'moz', 'webkit', 'o'];
-   for (var i = 0; i < vendors.length && !this.requestAnimationFrame; ++i) {
-     this.requestAnimationFrame = this[vendors[i] + 'RequestAnimationFrame'];
-     this.cancelAnimationFrame =
-         this[vendors[i]+'CancelAnimationFrame'] ||
-         this[vendors[i]+'CancelRequestAnimationFrame'];
+   for (var i = 0; i < vendors.length && !$this.requestAnimationFrame; ++i) {
+     $this.requestAnimationFrame = $this[vendors[i] + 'RequestAnimationFrame'];
+     $this.cancelAnimationFrame =
+         $this[vendors[i]+'CancelAnimationFrame'] ||
+         $this[vendors[i]+'CancelRequestAnimationFrame'];
    }
-   if (this.requestAnimationFrame && this.cancelAnimationFrame) return;
-   this.requestAnimationFrame = function(callback) {
+   if ($this.requestAnimationFrame && $this.cancelAnimationFrame) return;
+   $this.requestAnimationFrame = function(callback) {
       return window.setTimeout(function() {
         callback(Date.now());
       }, 16 /* 16ms ~= 60fps */);
    };
-   this.cancelAnimationFrame = function(id) { clearTimeout(id); }
-''';
+   $this.cancelAnimationFrame = function(id) { clearTimeout(id); }
+  })(#)""",
+       this);
+  }
 
 
   _IDBFactoryImpl get indexedDB => _get_indexedDB();
 
-  _IDBFactoryImpl _get_indexedDB() native
-      'return this.indexedDB || this.webkitIndexedDB || this.mozIndexedDB';
+  _IDBFactoryImpl _get_indexedDB() =>
+      JS('_IDBFactoryImpl',
+         '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
+         this, this, this);
 
   // TODO(kasperl): Document these.
   lookupPort(String name) {
@@ -126,12 +139,14 @@
     localStorage['dart-port:$name'] = JSON.stringify(serialized);
   }
 
-  String createObjectUrl(object) native '''
-    return (window.URL || window.webkitURL).createObjectURL(object)
-  ''';
+  String createObjectUrl(object) =>
+      JS('String',
+         '(window.URL || window.webkitURL).createObjectURL(#)', object);
 
-  void revokeObjectUrl(String objectUrl) native '''
-    (window.URL || window.webkitURL).revokeObjectURL(objectUrl)
-  ''';
+  void revokeObjectUrl(String objectUrl) {
+    JS('void',
+       '(window.URL || window.webkitURL).revokeObjectURL(#)', objectUrl);
+  }
+
 $!MEMBERS
 }
diff --git a/lib/html/templates/html/dart2js/impl_MouseEvent.darttemplate b/lib/html/templates/html/dart2js/impl_MouseEvent.darttemplate
index 1af6666..5d0485c 100644
--- a/lib/html/templates/html/dart2js/impl_MouseEvent.darttemplate
+++ b/lib/html/templates/html/dart2js/impl_MouseEvent.darttemplate
@@ -6,8 +6,8 @@
 $!MEMBERS
 
   int get offsetX {
-    if (JS('bool', '!!this.offsetX')) {
-      return this._offsetX;
+  if (JS('bool', '!!#.offsetX', this)) {
+      return JS('int', '#.offsetX', this);
     } else {
       // Firefox does not support offsetX.
       var target = this.target;
@@ -20,19 +20,16 @@
   }
 
   int get offsetY {
-    if (JS('bool', '!!this.offsetY')) {
-      return this._offsetY;
+    if (JS('bool', '!!#.offsetY', this)) {
+      return JS('int', '#.offsetY', this);
     } else {
       // Firefox does not support offsetY.
       var target = this.target;
       if (!(target is Element)) {
         throw const UnsupportedOperationException(
-            'offsetX is only supported on elements');
+            'offsetY is only supported on elements');
       }
       return this.clientY - this.target.getBoundingClientRect().top;
     }
   }
-
-  int get _offsetX() native 'return this.offsetX';
-  int get _offsetY() native 'return this.offsetY';
 }
diff --git a/lib/html/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/lib/html/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
index c4c066d..0112df0 100644
--- a/lib/html/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
+++ b/lib/html/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
@@ -29,13 +29,13 @@
   }
 
 $if DART2JS
-  void setProperty(String propertyName, String value, [String priority]) native '''
-    this.setProperty(propertyName, value, priority);
+  void setProperty(String propertyName, String value, [String priority]) {
+    JS('void', '#.setProperty(#, #, #)', this, propertyName, value, priority);
     // Bug #2772, IE9 requires a poke to actually apply the value.
-    if (this.setAttribute) {
-      this.setAttribute(propertyName, value);
+    if (JS('bool', '!!#.setAttribute', this)) {
+      JS('void', '#.setAttribute(#, #)', this, propertyName, value);
     }
-  ''';
+  }
 $endif
 
   // TODO(jacobr): generate this list of properties using the existing script.
diff --git a/lib/html/templates/html/impl/impl_Document.darttemplate b/lib/html/templates/html/impl/impl_Document.darttemplate
index 29d4cc5..77bd731 100644
--- a/lib/html/templates/html/impl/impl_Document.darttemplate
+++ b/lib/html/templates/html/impl/impl_Document.darttemplate
@@ -9,7 +9,7 @@
 {
 
 $!MEMBERS
-  // TODO(jacobr): implement all Element methods not on Document. 
+  // TODO(jacobr): implement all Element methods not on Document.
 
   _ElementImpl query(String selectors) {
     // It is fine for our RegExp to detect element id query selectors to have
diff --git a/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate b/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate
index b0ea538..e8a1e9d 100644
--- a/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate
+++ b/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate
@@ -46,7 +46,11 @@
     add(value);
   }
 
-  void sort(int compare(Element a, Element b)) {
+  bool contains(Element element) {
+    return element is Element && _childNodes.contains(element);
+  }
+
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('TODO(jacobr): should we impl?');
   }
 
diff --git a/lib/html/templates/html/impl/impl_Element.darttemplate b/lib/html/templates/html/impl/impl_Element.darttemplate
index 7e0732c..dc39ade 100644
--- a/lib/html/templates/html/impl/impl_Element.darttemplate
+++ b/lib/html/templates/html/impl/impl_Element.darttemplate
@@ -21,6 +21,8 @@
     return output;
   }
 
+  bool contains(Element element) => _childElements.contains(element);
+
   void forEach(void f(Element element)) {
     for (_ElementImpl element in _childElements) {
       f(element);
@@ -38,7 +40,7 @@
   }
 
   bool every(bool f(Element element)) {
-    for(Element element in this) {
+    for (Element element in this) {
       if (!f(element)) {
         return false;
       }
@@ -47,7 +49,7 @@
   }
 
   bool some(bool f(Element element)) {
-    for(Element element in this) {
+    for (Element element in this) {
       if (f(element)) {
         return true;
       }
@@ -99,7 +101,7 @@
     }
   }
 
-  void sort(int compare(Element a, Element b)) {
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('TODO(jacobr): should we impl?');
   }
 
@@ -159,6 +161,13 @@
     return _nodeList[0];
   }
 
+  bool contains(Element element) {
+    for (Element el in this) {
+      if (el == element) return true;
+    }
+    return false;
+  }
+
   void forEach(void f(Element element)) {
     for (Element el in this) {
       f(el);
@@ -227,7 +236,7 @@
     throw const UnsupportedOperationException('');
   }
 
-  void sort(int compare(Element a, Element b)) {
+  void sort([Comparator<Element> compare = Comparable.compare]) {
     throw const UnsupportedOperationException('');
   }
 
@@ -743,7 +752,7 @@
 $if DART2JS
   /** @domName Element.insertAdjacentText */
   void insertAdjacentText(String where, String text) {
-    if (JS('bool', '!!this.insertAdjacentText')) {
+    if (JS('bool', '!!#.insertAdjacentText', this)) {
       _insertAdjacentText(where, text);
     } else {
       _insertAdjacentNode(where, new Text(text));
@@ -755,7 +764,7 @@
 
   /** @domName Element.insertAdjacentHTML */
   void insertAdjacentHTML(String where, String text) {
-    if (JS('bool', '!!this.insertAdjacentHTML')) {
+    if (JS('bool', '!!#.insertAdjacentHTML', this)) {
       _insertAdjacentHTML(where, text);
     } else {
       _insertAdjacentNode(where, new DocumentFragment.html(text));
@@ -767,7 +776,7 @@
 
   /** @domName Element.insertAdjacentHTML */
   Element insertAdjacentElement(String where, Element element) {
-    if (JS('bool', '!!this.insertAdjacentElement')) {
+    if (JS('bool', '!!#.insertAdjacentElement', this)) {
       _insertAdjacentElement(where, element);
     } else {
       _insertAdjacentNode(where, element);
@@ -862,8 +871,8 @@
 $if DART2JS
   // Optimization to improve performance until the dart2js compiler inlines this
   // method.
-  static Element createElement_tag(String tag)
-      native "return document.createElement(tag)";
+  static Element createElement_tag(String tag) =>
+      JS('Element', 'document.createElement(#)', tag);
 $else
   static Element createElement_tag(String tag) =>
       _document.$dom_createElement(tag);
diff --git a/lib/html/templates/html/impl/impl_MutationObserver.darttemplate b/lib/html/templates/html/impl/impl_MutationObserver.darttemplate
index 528b0fc..4ae3c21 100644
--- a/lib/html/templates/html/impl/impl_MutationObserver.darttemplate
+++ b/lib/html/templates/html/impl/impl_MutationObserver.darttemplate
@@ -5,14 +5,14 @@
 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
 $!MEMBERS
   void observe(Node target,
-               [Map options,
+               {Map options,
                 bool childList,
                 bool attributes,
                 bool characterData,
                 bool subtree,
                 bool attributeOldValue,
                 bool characterDataOldValue,
-                List<String> attributeFilter]) {
+                List<String> attributeFilter}) {
 
     // Parse options into map of known type.
     var parsedOptions = _createDict();
diff --git a/lib/html/templates/html/impl/impl_Node.darttemplate b/lib/html/templates/html/impl/impl_Node.darttemplate
index 58f6b22..8b369d1 100644
--- a/lib/html/templates/html/impl/impl_Node.darttemplate
+++ b/lib/html/templates/html/impl/impl_Node.darttemplate
@@ -56,6 +56,8 @@
 
   // TODO(jacobr): We can implement these methods much more efficiently by
   // looking up the nodeList only once instead of once per iteration.
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -73,7 +75,7 @@
 
   // TODO(jacobr): this could be implemented for child node lists.
   // The exception we throw here is misleading.
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw new UnsupportedOperationException("Cannot sort immutable List.");
   }
 
diff --git a/lib/html/templates/html/impl/impl_NodeList.darttemplate b/lib/html/templates/html/impl/impl_NodeList.darttemplate
index 53972b9..7a42e98 100644
--- a/lib/html/templates/html/impl/impl_NodeList.darttemplate
+++ b/lib/html/templates/html/impl/impl_NodeList.darttemplate
@@ -11,6 +11,8 @@
 
   Iterator<E> iterator() => _list.iterator();
 
+  bool contains(E element) => _list.contains(element);
+
   void forEach(void f(E element)) => _list.forEach(f);
 
   Collection map(f(E element)) => _list.map(f);
@@ -37,7 +39,7 @@
 
   void addAll(Collection<E> collection) => _list.addAll(collection);
 
-  void sort(int compare(E a, E b)) => _list.sort(compare);
+  void sort([Comparator<E> compare = Comparable.compare]) => _list.sort(compare);
 
   int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
 
@@ -126,6 +128,8 @@
     _parent.$dom_replaceChild(value, this[index]);
   }
 
+  bool contains(Node element) => _Collections.contains(this, element);
+
   void forEach(void f(Node element)) => _Collections.forEach(this, f);
 
   Collection map(f(Node element)) => _Collections.map(this, [], f);
@@ -141,7 +145,7 @@
 
   // From List<Node>:
 
-  void sort(int compare(Node a, Node b)) {
+  void sort([Comparator<Node> compare = Comparable.compare]) {
     throw new UnsupportedOperationException("Cannot sort immutable List.");
   }
 
diff --git a/lib/html/templates/html/impl/impl_WheelEvent.darttemplate b/lib/html/templates/html/impl/impl_WheelEvent.darttemplate
index e4b6609..37873a5 100644
--- a/lib/html/templates/html/impl/impl_WheelEvent.darttemplate
+++ b/lib/html/templates/html/impl/impl_WheelEvent.darttemplate
@@ -69,12 +69,12 @@
     return this._deltaMode;
   }
 
-  num get _deltaY() native 'return this.deltaY';
-  num get _deltaX() native 'return this.deltaX';
-  num get _wheelDelta() native 'return this.wheelDelta';
-  num get _wheelDeltaX() native 'return this.wheelDeltaX';
-  num get _detail() native 'return this.detail';
-  int get _deltaMode() native 'return this.deltaMode';
+  num get _deltaY => JS('num', '#.deltaY', this);
+  num get _deltaX => JS('num', '#.deltaX', this);
+  num get _wheelDelta => JS('num', '#.wheelDelta', this);
+  num get _wheelDeltaX => JS('num', '#.wheelDeltaX', this);
+  num get _detail => JS('num', '#.detail', this);
+  int get _deltaMode => JS('int', '#.deltaMode', this);
 
 $else
   num get deltaX => $dom_wheelDeltaX;
diff --git a/lib/html/templates/html/interface/interface_MutationObserver.darttemplate b/lib/html/templates/html/interface/interface_MutationObserver.darttemplate
index 99ba8a9..bde6196 100644
--- a/lib/html/templates/html/interface/interface_MutationObserver.darttemplate
+++ b/lib/html/templates/html/interface/interface_MutationObserver.darttemplate
@@ -8,12 +8,12 @@
 abstract class $ID$EXTENDS {
 $!MEMBERS
   void observe(Node target,
-               [Map options,
+               {Map options,
                 bool childList,
                 bool attributes,
                 bool characterData,
                 bool subtree,
                 bool attributeOldValue,
                 bool characterDataOldValue,
-                List<String> attributeFilter]);
+                List<String> attributeFilter});
 }
diff --git a/lib/html/templates/immutable_list_mixin.darttemplate b/lib/html/templates/immutable_list_mixin.darttemplate
index 8df2d33..d72fc5d 100644
--- a/lib/html/templates/immutable_list_mixin.darttemplate
+++ b/lib/html/templates/immutable_list_mixin.darttemplate
@@ -24,6 +24,12 @@
     throw const UnsupportedOperationException("Cannot add to immutable List.");
   }
 
+$if DEFINE_CONTAINS
+  bool contains($E element) => _Collections.contains(this, element);
+$else
+  // contains() defined by IDL.
+$endif
+
   void forEach(void f($E element)) => _Collections.forEach(this, f);
 
   Collection map(f($E element)) => _Collections.map(this, [], f);
@@ -39,7 +45,7 @@
 
   // From List<$E>:
 
-  void sort(int compare($E a, $E b)) {
+  void sort([Comparator<$E> compare = Comparable.compare]) {
     throw const UnsupportedOperationException("Cannot sort immutable List.");
   }
 
diff --git a/pkg/args/lib/args.dart b/pkg/args/lib/args.dart
index c2db6e3..f97c1bd 100644
--- a/pkg/args/lib/args.dart
+++ b/pkg/args/lib/args.dart
@@ -230,8 +230,8 @@
    * * There is already an option named [name].
    * * There is already an option using abbreviation [abbr].
    */
-  void addFlag(String name, [String abbr, String help, bool defaultsTo = false,
-      bool negatable = true, void callback(bool value)]) {
+  void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
+      bool negatable: true, void callback(bool value)}) {
     _addOption(name, abbr, help, null, null, defaultsTo, callback,
         isFlag: true, negatable: negatable);
   }
@@ -242,17 +242,17 @@
    * * There is already an option with name [name].
    * * There is already an option using abbreviation [abbr].
    */
-  void addOption(String name, [String abbr, String help, List<String> allowed,
+  void addOption(String name, {String abbr, String help, List<String> allowed,
       Map<String, String> allowedHelp, String defaultsTo,
-      void callback(value), bool allowMultiple = false]) {
+      void callback(value), bool allowMultiple: false}) {
     _addOption(name, abbr, help, allowed, allowedHelp, defaultsTo,
         callback, isFlag: false, allowMultiple: allowMultiple);
   }
 
   void _addOption(String name, String abbr, String help, List<String> allowed,
       Map<String, String> allowedHelp, defaultsTo,
-      void callback(value), [bool isFlag, bool negatable = false,
-      bool allowMultiple = false]) {
+      void callback(value), {bool isFlag, bool negatable: false,
+      bool allowMultiple: false}) {
     // Make sure the name isn't in use.
     if (_options.containsKey(name)) {
       throw new ArgumentError('Duplicate option "$name".');
@@ -560,8 +560,8 @@
   final bool allowMultiple;
 
   _Option(this.name, this.abbreviation, this.help, this.allowed,
-      this.allowedHelp, this.defaultValue, this.callback, [this.isFlag,
-      this.negatable, this.allowMultiple = false]);
+      this.allowedHelp, this.defaultValue, this.callback, {this.isFlag,
+      this.negatable, this.allowMultiple: false});
 }
 
 /**
diff --git a/pkg/dartdoc/bin/dartdoc.dart b/pkg/dartdoc/bin/dartdoc.dart
index 4bddd72..5e728e8 100644
--- a/pkg/dartdoc/bin/dartdoc.dart
+++ b/pkg/dartdoc/bin/dartdoc.dart
@@ -98,6 +98,16 @@
       defaultsTo: false, negatable: false,
       callback: (linkApi) => dartdoc.linkToApi = linkApi);
 
+  argParser.addFlag('show-private',
+      help: 'Document private types and members.',
+      defaultsTo: false,
+      callback: (showPrivate) => dartdoc.showPrivate = showPrivate);
+
+  argParser.addFlag('inherit-from-object',
+      help: 'Show members inherited from Object.',
+      defaultsTo: false, negatable: false,
+      callback: (inherit) => dartdoc.inheritFromObject = inherit);
+
   argParser.addFlag('enable-diagnostic-colors', negatable: false);
 
   argParser.addOption('out',
diff --git a/pkg/dartdoc/lib/dartdoc.dart b/pkg/dartdoc/lib/dartdoc.dart
index 5acdba1..d3380d1 100644
--- a/pkg/dartdoc/lib/dartdoc.dart
+++ b/pkg/dartdoc/lib/dartdoc.dart
@@ -195,6 +195,12 @@
   /** Set this to generate links to the online API. */
   bool linkToApi = false;
 
+  /** Set this to generate docs for private types and members. */
+  bool showPrivate = false;
+
+  /** Set this to inherit from Object. */
+  bool inheritFromObject = false;
+
   /** Set this to select the libraries to include in the documentation. */
   List<String> includedLibraries = const <String>[];
 
@@ -572,7 +578,7 @@
 
     final types = [];
     for (InterfaceMirror type in orderByName(library.types.getValues())) {
-      if (type.isPrivate) continue;
+      if (!showPrivate && type.isPrivate) continue;
 
       var typeInfo = {};
       typeInfo[NAME] = type.displayName;
@@ -608,7 +614,7 @@
   List docMembersJson(Map<Object,MemberMirror> memberMap) {
     final members = [];
     for (MemberMirror member in orderByName(memberMap.getValues())) {
-      if (member.isPrivate) continue;
+      if (!showPrivate && member.isPrivate) continue;
 
       var memberInfo = {};
       if (member.isField) {
@@ -670,7 +676,7 @@
     final exceptions = <InterfaceMirror>[];
 
     for (InterfaceMirror type in orderByName(library.types.getValues())) {
-      if (type.isPrivate) continue;
+      if (!showPrivate && type.isPrivate) continue;
 
       if (isException(type)) {
         exceptions.add(type);
@@ -736,7 +742,7 @@
     final exceptions = <InterfaceMirror>[];
 
     for (InterfaceMirror type in orderByName(library.types.getValues())) {
-      if (type.isPrivate) continue;
+      if (!showPrivate && type.isPrivate) continue;
 
       if (isException(type)) {
         exceptions.add(type);
@@ -760,7 +766,7 @@
     endFile();
 
     for (final type in library.types.getValues()) {
-      if (type.isPrivate) continue;
+      if (!showPrivate && type.isPrivate) continue;
 
       docType(type);
     }
@@ -827,7 +833,6 @@
     docInheritance(type);
     docTypedef(type);
 
-    docConstructors(type);
     docMembers(type);
 
     writeTypeFooter();
@@ -876,8 +881,13 @@
     listTypes(types, header) {
       if (types == null) return;
 
-      // Skip private types.
-      final publicTypes = new List.from(types.filter((t) => !t.isPrivate));
+      var publicTypes;
+      if (showPrivate) {
+        publicTypes = types;
+      } else {
+        // Skip private types.
+        publicTypes = new List.from(types.filter((t) => !t.isPrivate));
+      }
       if (publicTypes.length == 0) return;
 
       writeln('<h3>$header</h3>');
@@ -975,28 +985,6 @@
     writeln('</div>');
   }
 
-  /** Document the constructors for [Type], if any. */
-  void docConstructors(InterfaceMirror type) {
-    final constructors = <MethodMirror>[];
-    for (var constructor in type.constructors.getValues()) {
-       if (!constructor.isPrivate) {
-         constructors.add(constructor);
-       }
-    }
-
-    if (constructors.length > 0) {
-      writeln('<div>');
-      writeln('<h3>Constructors</h3>');
-      constructors.sort((x, y) => x.constructorName.toUpperCase().compareTo(
-                                  y.constructorName.toUpperCase()));
-
-      for (final constructor in constructors) {
-        docMethod(type, constructor);
-      }
-      writeln('</div>');
-    }
-  }
-
   static const operatorOrder = const <String>[
       '[]', '[]=', // Indexing.
       '+', Mirror.UNARY_MINUS, '-', '*', '/', '~/', '%', // Arithmetic.
@@ -1025,9 +1013,10 @@
     final instanceOperators = [];
     final instanceGetters = new Map<String,MemberMirror>();
     final instanceSetters = new Map<String,MemberMirror>();
+    final constructors = [];
 
     host.declaredMembers.forEach((_, MemberMirror member) {
-      if (member.isPrivate) return;
+      if (!showPrivate && member.isPrivate) return;
       if (host is LibraryMirror || member.isStatic) {
         if (member is MethodMirror) {
           if (member.isGetter) {
@@ -1046,34 +1035,69 @@
     if (host is InterfaceMirror) {
       var iterable = new HierarchyIterable(host, includeType: true);
       for (InterfaceMirror type in iterable) {
+        if (!host.isObject && !inheritFromObject && type.isObject) continue;
+
         type.declaredMembers.forEach((_, MemberMirror member) {
-          if (member.isPrivate) return;
-          if (!member.isStatic) {
-            if (member.isField) {
-              // Fields override both getters and setters.
-              memberMap.putIfAbsent(member.simpleName, () => member);
-              memberMap.putIfAbsent('${member.simpleName}=', () => member);
-            } else {
-              memberMap.putIfAbsent(member.simpleName, () => member);
+          if (member.isStatic) return;
+          if (!showPrivate && member.isPrivate) return;
+
+          bool inherit = true;
+          if (type !== host) {
+            if (member.isPrivate) {
+              // Don't inherit private members.
+              inherit = false;
             }
+            if (member.isConstructor) {
+              // Don't inherit constructors.
+              inherit = false;
+            }
+          }
+          if (!inherit) return;
+
+          if (member.isField) {
+            // Fields override both getters and setters.
+            memberMap.putIfAbsent(member.simpleName, () => member);
+            memberMap.putIfAbsent('${member.simpleName}=', () => member);
+          } else if (member.isConstructor) {
+            constructors.add(member);
+          } else {
+            memberMap.putIfAbsent(member.simpleName, () => member);
           }
         });
       }
     }
 
+    bool allMethodsInherited = true;
+    bool allPropertiesInherited = true;
+    bool allOperatorsInherited = true;
     memberMap.forEach((_, MemberMirror member) {
       if (member is MethodMirror) {
         if (member.isGetter) {
           instanceGetters[member.displayName] = member;
+          if (member.surroundingDeclaration == host) {
+            allPropertiesInherited = false;
+          }
         } else if (member.isSetter) {
           instanceSetters[member.displayName] = member;
+          if (member.surroundingDeclaration == host) {
+            allPropertiesInherited = false;
+          }
         } else if (member.isOperator) {
           instanceOperators.add(member);
+          if (member.surroundingDeclaration == host) {
+            allOperatorsInherited = false;
+          }
         } else {
           instanceMethods.add(member);
+          if (member.surroundingDeclaration == host) {
+            allMethodsInherited = false;
+          }
         }
       } else if (member is FieldMirror) {
         instanceGetters[member.displayName] = member;
+        if (member.surroundingDeclaration == host) {
+          allPropertiesInherited = false;
+        }
       }
     });
 
@@ -1084,14 +1108,19 @@
 
     docProperties(host,
                   host is LibraryMirror ? 'Properties' : 'Static Properties',
-                  staticGetters, staticSetters);
+                  staticGetters, staticSetters, allInherited: false);
     docMethods(host,
                host is LibraryMirror ? 'Functions' : 'Static Methods',
-               staticMethods);
+               staticMethods, allInherited: false);
 
-    docProperties(host, 'Properties', instanceGetters, instanceSetters);
-    docMethods(host, 'Operators', instanceOperators);
-    docMethods(host, 'Methods', orderByName(instanceMethods));
+    docMethods(host, 'Constructors', orderByName(constructors),
+               allInherited: false);
+    docProperties(host, 'Properties', instanceGetters, instanceSetters,
+                  allInherited: allPropertiesInherited);
+    docMethods(host, 'Operators', instanceOperators,
+               allInherited: allOperatorsInherited);
+    docMethods(host, 'Methods', orderByName(instanceMethods),
+               allInherited: allMethodsInherited);
   }
 
   /**
@@ -1099,7 +1128,8 @@
    */
   void docProperties(ObjectMirror host, String title,
                      Map<String,MemberMirror> getters,
-                     Map<String,MemberMirror> setters) {
+                     Map<String,MemberMirror> setters,
+                     {bool allInherited}) {
     if (getters.isEmpty() && setters.isEmpty()) return;
 
     var nameSet = new Set<String>.from(getters.getKeys());
@@ -1109,7 +1139,7 @@
       return a.toLowerCase().compareTo(b.toLowerCase());
     });
 
-    writeln('<div>');
+    writeln('<div${allInherited ? ' class="inherited"' : ''}>');
     writeln('<h3>$title</h3>');
     for (String name in nameList) {
       MemberMirror getter = getters[name];
@@ -1155,9 +1185,10 @@
     writeln('</div>');
   }
 
-  void docMethods(ObjectMirror host, String title, List<MethodMirror> methods) {
+  void docMethods(ObjectMirror host, String title, List<MethodMirror> methods,
+                  {bool allInherited}) {
     if (methods.length > 0) {
-      writeln('<div>');
+      writeln('<div${allInherited ? ' class="inherited"' : ''}>');
       writeln('<h3>$title</h3>');
       for (final method in methods) {
         docMethod(host, method);
@@ -1605,7 +1636,7 @@
   }
 
   /** Generates a human-friendly string representation for a type. */
-  typeName(TypeMirror type, [bool showBounds = false]) {
+  typeName(TypeMirror type, {bool showBounds: false}) {
     if (type.isVoid) {
       return 'void';
     }
@@ -1676,9 +1707,9 @@
    * style it appropriately.
    */
   md.Node resolveNameReference(String name,
-                               [MemberMirror currentMember = null,
-                                ObjectMirror currentType = null,
-                                LibraryMirror currentLibrary = null]) {
+                               {MemberMirror currentMember,
+                                ObjectMirror currentType,
+                                LibraryMirror currentLibrary}) {
     makeLink(String href) {
       final anchor = new md.Element.text('a', name);
       anchor.attributes['href'] = relativePath(href);
diff --git a/pkg/dartdoc/lib/src/dartdoc/comment_map.dart b/pkg/dartdoc/lib/src/dartdoc/comment_map.dart
index 406da4d..87f9940 100644
--- a/pkg/dartdoc/lib/src/dartdoc/comment_map.dart
+++ b/pkg/dartdoc/lib/src/dartdoc/comment_map.dart
@@ -58,7 +58,8 @@
   _parseComments(Source source) {
     final comments = new Map<int, String>();
 
-    final scanner = new dart2js.StringScanner(source.text, true);
+    final scanner = new dart2js.StringScanner(source.text,
+                                              includeComments: true);
     var lastComment = null;
 
     var token = scanner.tokenize();
diff --git a/pkg/dartdoc/lib/src/dartdoc/utils.dart b/pkg/dartdoc/lib/src/dartdoc/utils.dart
index e6c2a10..c70e166 100644
--- a/pkg/dartdoc/lib/src/dartdoc/utils.dart
+++ b/pkg/dartdoc/lib/src/dartdoc/utils.dart
@@ -24,7 +24,7 @@
 }
 
 /** Repeats [text] [count] times, separated by [separator] if given. */
-String repeat(String text, int count, [String separator]) {
+String repeat(String text, int count, {String separator}) {
   // TODO(rnystrom): Should be in corelib.
   final buffer = new StringBuffer();
   for (int i = 0; i < count; i++) {
diff --git a/pkg/dartdoc/lib/src/markdown/inline_parser.dart b/pkg/dartdoc/lib/src/markdown/inline_parser.dart
index 587edf7..eb941a7 100644
--- a/pkg/dartdoc/lib/src/markdown/inline_parser.dart
+++ b/pkg/dartdoc/lib/src/markdown/inline_parser.dart
@@ -174,7 +174,7 @@
 /// Matches stuff that should just be passed through as straight text.
 class TextSyntax extends InlineSyntax {
   String substitute;
-  TextSyntax(String pattern, [String sub])
+  TextSyntax(String pattern, {String sub})
     : super(pattern),
       substitute = sub;
 
@@ -214,7 +214,7 @@
   final RegExp endPattern;
   final String tag;
 
-  TagSyntax(String pattern, [String tag, String end = null])
+  TagSyntax(String pattern, {String tag, String end})
     : super(pattern),
       endPattern = new RegExp((end != null) ? end : pattern, multiLine: true),
       tag = tag;
diff --git a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
index 1925ec2..c400db2 100644
--- a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
+++ b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
@@ -2,27 +2,29 @@
 // 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('mirrors.dart2js');
+library mirrors_dart2js;
 
-#import('dart:io');
-#import('dart:uri');
+import 'dart:io';
+import 'dart:uri';
 
-#import('../../../../../lib/compiler/compiler.dart', prefix: 'diagnostics');
-#import('../../../../../lib/compiler/implementation/elements/elements.dart');
-#import('../../../../../lib/compiler/implementation/apiimpl.dart', prefix: 'api');
-#import('../../../../../lib/compiler/implementation/scanner/scannerlib.dart');
-#import('../../../../../lib/compiler/implementation/ssa/ssa.dart');
-#import('../../../../../lib/compiler/implementation/leg.dart');
-#import('../../../../../lib/compiler/implementation/filenames.dart');
-#import('../../../../../lib/compiler/implementation/source_file.dart');
-#import('../../../../../lib/compiler/implementation/tree/tree.dart');
-#import('../../../../../lib/compiler/implementation/util/util.dart');
-#import('../../../../../lib/compiler/implementation/util/uri_extras.dart');
-#import('../../../../../lib/compiler/implementation/dart2js.dart');
+import '../../../../../lib/compiler/compiler.dart' as diagnostics;
+import '../../../../../lib/compiler/implementation/elements/elements.dart';
+import '../../../../../lib/compiler/implementation/resolution/resolution.dart'
+    show ResolverTask, ResolverVisitor;
+import '../../../../../lib/compiler/implementation/apiimpl.dart' as api;
+import '../../../../../lib/compiler/implementation/scanner/scannerlib.dart';
+import '../../../../../lib/compiler/implementation/ssa/ssa.dart';
+import '../../../../../lib/compiler/implementation/dart2jslib.dart';
+import '../../../../../lib/compiler/implementation/filenames.dart';
+import '../../../../../lib/compiler/implementation/source_file.dart';
+import '../../../../../lib/compiler/implementation/tree/tree.dart';
+import '../../../../../lib/compiler/implementation/util/util.dart';
+import '../../../../../lib/compiler/implementation/util/uri_extras.dart';
+import '../../../../../lib/compiler/implementation/dart2js.dart';
 
 // TODO(rnystrom): Use "package:" URL (#4968).
-#import('../../mirrors.dart');
-#import('util.dart');
+import '../../mirrors.dart';
+import 'util.dart';
 
 //------------------------------------------------------------------------------
 // Utility types and functions for the dart2js mirror system
@@ -162,7 +164,7 @@
 class Dart2JsDiagnosticListener implements DiagnosticListener {
   const Dart2JsDiagnosticListener();
 
-  void cancel([String reason, node, token, instruction, element]) {
+  void cancel(String reason, {node, token, instruction, element}) {
     print(reason);
   }
 
@@ -171,8 +173,8 @@
   }
 
   void internalError(String message,
-                     [Node node, Token token, HInstruction instruction,
-                      Element element]) {
+                     {Node node, Token token, HInstruction instruction,
+                      Element element}) {
     cancel('Internal error: $message', node, token, instruction, element);
   }
 
@@ -508,23 +510,21 @@
   void _ensureTypes() {
     if (_types == null) {
       _types = <String, InterfaceMirror>{};
-      _library.forEachExport((Element e) {
-        if (e.getLibrary() == _library) {
-          if (e.isClass()) {
-            e.ensureResolved(system.compiler);
-            var type = new Dart2JsInterfaceMirror.fromLibrary(this, e);
-            assert(invariant(_library, !_types.containsKey(type.simpleName),
-                message: "Type name '${type.simpleName}' "
-                         "is not unique in $_library."));
-            _types[type.simpleName] = type;
-          } else if (e.isTypedef()) {
-            var type = new Dart2JsTypedefMirror.fromLibrary(this,
-                e.computeType(system.compiler));
-            assert(invariant(_library, !_types.containsKey(type.simpleName),
-                message: "Type name '${type.simpleName}' "
-                         "is not unique in $_library."));
-            _types[type.simpleName] = type;
-          }
+      _library.forEachLocalMember((Element e) {
+        if (e.isClass()) {
+          e.ensureResolved(system.compiler);
+          var type = new Dart2JsInterfaceMirror.fromLibrary(this, e);
+          assert(invariant(_library, !_types.containsKey(type.simpleName),
+              message: "Type name '${type.simpleName}' "
+                       "is not unique in $_library."));
+          _types[type.simpleName] = type;
+        } else if (e.isTypedef()) {
+          var type = new Dart2JsTypedefMirror.fromLibrary(this,
+              e.computeType(system.compiler));
+          assert(invariant(_library, !_types.containsKey(type.simpleName),
+              message: "Type name '${type.simpleName}' "
+                       "is not unique in $_library."));
+          _types[type.simpleName] = type;
         }
       });
     }
@@ -533,7 +533,7 @@
   void _ensureMembers() {
     if (_members == null) {
       _members = <String, MemberMirror>{};
-      _library.forEachExport((Element e) {
+      _library.forEachLocalMember((Element e) {
         if (!e.isClass() && !e.isTypedef()) {
           for (var member in _convertElementMemberToMemberMirrors(this, e)) {
             assert(!_members.containsKey(member.simpleName));
@@ -1305,7 +1305,8 @@
 
   bool get isMethod => !isConstructor;
 
-  bool get isPrivate => _isPrivate(simpleName);
+  bool get isPrivate =>
+      isConstructor ? _isPrivate(constructorName) : _isPrivate(simpleName);
 
   bool get isStatic => _function.modifiers.isStatic();
 
diff --git a/pkg/intl/example/basic/basic_example.dart b/pkg/intl/example/basic/basic_example.dart
index 8c564e0..87223d0 100644
--- a/pkg/intl/example/basic/basic_example.dart
+++ b/pkg/intl/example/basic/basic_example.dart
@@ -45,7 +45,7 @@
 // futures have completed. We are passed the collection of futures, but we
 // don't need to use them, so ignore the parameter.
 runProgram(List<Future> _) {
-  var aDate = new Date.fromMillisecondsSinceEpoch(0, true);
+  var aDate = new Date.fromMillisecondsSinceEpoch(0, isUtc: true);
   var de = new Intl('de_DE');
   var th = new Intl('th_TH');
   // This defines a message that can be internationalized. It is written as a
diff --git a/pkg/intl/lib/bidi_formatter.dart b/pkg/intl/lib/bidi_formatter.dart
index f418ad2..7a52fac 100644
--- a/pkg/intl/lib/bidi_formatter.dart
+++ b/pkg/intl/lib/bidi_formatter.dart
@@ -113,9 +113,9 @@
    * a trailing unicode BiDi mark matching the context directionality is
    * appended (LRM or RLM). If [isHtml] is false, we HTML-escape the [text].
    */
-  String wrapWithSpan(String text, [bool isHtml=false, bool resetDir=true,
-                  TextDirection direction]) {
-    if (direction == null) direction = estimateDirection(text, isHtml);
+  String wrapWithSpan(String text, {bool isHtml: false, bool resetDir: true,
+                      TextDirection direction}) {
+    if (direction == null) direction = estimateDirection(text, isHtml: isHtml);
     var result;
     if (!isHtml) text = htmlEscape(text);
     var directionChange = contextDirection.isDirectionChange(direction);
@@ -150,9 +150,9 @@
    * [isHtml]. [isHtml] is used to designate if the text contains HTML (escaped
    * or unescaped).
    */
-  String wrapWithUnicode(String text, [bool isHtml=false, bool resetDir=true,
-                     TextDirection direction]) {
-    if (direction == null) direction = estimateDirection(text, isHtml);
+  String wrapWithUnicode(String text, {bool isHtml: false, bool resetDir: true,
+                         TextDirection direction}) {
+    if (direction == null) direction = estimateDirection(text, isHtml: isHtml);
     var result = text;
     if (contextDirection.isDirectionChange(direction)) {
       var marker = direction == TextDirection.RTL ? Bidi.RLE : Bidi.LRE;
@@ -168,8 +168,8 @@
    * TextDirection.UNKNOWN return value indicates completely neutral input.
    * [isHtml] is true if [text] HTML or HTML-escaped.
    */
-  TextDirection estimateDirection(String text, [bool isHtml=false]) {
-    return Bidi.estimateDirectionOfText(text, isHtml); //TODO~!!!
+  TextDirection estimateDirection(String text, {bool isHtml: false}) {
+    return Bidi.estimateDirectionOfText(text, isHtml: isHtml); //TODO~!!!
   }
 
   /**
diff --git a/pkg/intl/lib/bidi_utils.dart b/pkg/intl/lib/bidi_utils.dart
index 50e6ef9..778f278 100644
--- a/pkg/intl/lib/bidi_utils.dart
+++ b/pkg/intl/lib/bidi_utils.dart
@@ -315,7 +315,8 @@
    * Otherwise, returns UNKNOWN, which is used to mean `neutral`.
    * Numbers and URLs are counted as weakly LTR.
    */
-  static TextDirection estimateDirectionOfText(String text, [bool isHtml=false]) {
+  static TextDirection estimateDirectionOfText(String text,
+                                               {bool isHtml: false}) {
     text = isHtml? stripHtmlIfNeeded(text) : text;
     var rtlCount = 0;
     var total = 0;
@@ -393,7 +394,7 @@
    * text should be laid out in RTL direction. If [isHtml] is true, the string
    * is HTML or HTML-escaped.
    */
-  static bool detectRtlDirectionality(String str, [bool isHtml]) {
-    return estimateDirectionOfText(str, isHtml) == TextDirection.RTL;
+  static bool detectRtlDirectionality(String str, {bool isHtml: false}) {
+    return estimateDirectionOfText(str, isHtml: isHtml) == TextDirection.RTL;
   }
 }
\ No newline at end of file
diff --git a/pkg/intl/lib/date_symbols.dart b/pkg/intl/lib/date_symbols.dart
index 8b6ff16..5c2f8df 100644
--- a/pkg/intl/lib/date_symbols.dart
+++ b/pkg/intl/lib/date_symbols.dart
@@ -24,34 +24,34 @@
   List<int> WEEKENDRANGE;
   int FIRSTWEEKCUTOFFDAY;
 
-  DateSymbols([this.NAME,
-                     this.ERAS,
-                     this.ERANAMES,
-                     this.NARROWMONTHS,
-                     this.STANDALONENARROWMONTHS,
-                     this.MONTHS,
-                     this.STANDALONEMONTHS,
-                     this.SHORTMONTHS,
-                     this.STANDALONESHORTMONTHS,
-                     this.WEEKDAYS,
-                     this.STANDALONEWEEKDAYS,
-                     this.SHORTWEEKDAYS,
-                     this.STANDALONESHORTWEEKDAYS,
-                     this.NARROWWEEKDAYS,
-                     this.STANDALONENARROWWEEKDAYS,
-                     this.SHORTQUARTERS,
-                     this.QUARTERS,
-                     this.AMPMS,
-                     // TODO(alanknight): These formats are taken from Closure,
-                     // where there's only a fixed set of available formats.
-                     // Here we have the patterns separately. These should
-                     // either be used, or removed.
-                     this.DATEFORMATS,
-                     this.TIMEFORMATS,
-                     this.AVAILABLEFORMATS,
-                     this.FIRSTDAYOFWEEK,
-                     this.WEEKENDRANGE,
-                     this.FIRSTWEEKCUTOFFDAY]);
+  DateSymbols({this.NAME,
+               this.ERAS,
+               this.ERANAMES,
+               this.NARROWMONTHS,
+               this.STANDALONENARROWMONTHS,
+               this.MONTHS,
+               this.STANDALONEMONTHS,
+               this.SHORTMONTHS,
+               this.STANDALONESHORTMONTHS,
+               this.WEEKDAYS,
+               this.STANDALONEWEEKDAYS,
+               this.SHORTWEEKDAYS,
+               this.STANDALONESHORTWEEKDAYS,
+               this.NARROWWEEKDAYS,
+               this.STANDALONENARROWWEEKDAYS,
+               this.SHORTQUARTERS,
+               this.QUARTERS,
+               this.AMPMS,
+               // TODO(alanknight): These formats are taken from Closure,
+               // where there's only a fixed set of available formats.
+               // Here we have the patterns separately. These should
+               // either be used, or removed.
+               this.DATEFORMATS,
+               this.TIMEFORMATS,
+               this.AVAILABLEFORMATS,
+               this.FIRSTDAYOFWEEK,
+               this.WEEKENDRANGE,
+               this.FIRSTWEEKCUTOFFDAY});
 
   // TODO(alanknight): Replace this with use of a more general serialization
   // facility once one is available. Issue 4926.
diff --git a/pkg/intl/lib/intl.dart b/pkg/intl/lib/intl.dart
index 1b6494c..e2e00dd 100644
--- a/pkg/intl/lib/intl.dart
+++ b/pkg/intl/lib/intl.dart
@@ -127,9 +127,9 @@
    * will be extracted automatically but for the time being it must be passed
    * explicitly in the [name] and [args] arguments.
    */
-  static String message(String message_str, [final String desc='',
-      final Map examples=const {}, String locale, String name,
-      List<String> args]) {
+  static String message(String message_str, {final String desc: '',
+      final Map examples: const {}, String locale, String name,
+      List<String> args}) {
     return messageLookup.lookupMessage(
         message_str, desc, examples, locale, name, args);
   }
@@ -159,7 +159,7 @@
    * [newLocale] is null it will be returned.
    */
   static String verifiedLocale(String newLocale, Function localeExists,
-                               [Function onFailure = _throwLocaleError]) {
+                               {Function onFailure: _throwLocaleError}) {
     // TODO(alanknight): Previously we kept a single verified locale on the Intl
     // object, but with different verification for different uses, that's more
     // difficult. As a result, we call this more often. Consider keeping
diff --git a/pkg/intl/lib/number_symbols.dart b/pkg/intl/lib/number_symbols.dart
index cc68ab6..2d51362 100644
--- a/pkg/intl/lib/number_symbols.dart
+++ b/pkg/intl/lib/number_symbols.dart
@@ -16,7 +16,7 @@
       MINUS_SIGN, EXP_SYMBOL, PERMILL, INFINITY, NAN, DECIMAL_PATTERN,
       SCIENTIFIC_PATTERN, PERCENT_PATTERN, CURRENCY_PATTERN, DEF_CURRENCY_CODE;
 
-  const NumberSymbols([this.NAME,
+  const NumberSymbols({this.NAME,
                        this.DECIMAL_SEP,
                        this.GROUP_SEP,
                        this.PERCENT,
@@ -31,7 +31,7 @@
                        this.SCIENTIFIC_PATTERN,
                        this.PERCENT_PATTERN,
                        this.CURRENCY_PATTERN,
-                       this.DEF_CURRENCY_CODE]);
+                       this.DEF_CURRENCY_CODE});
 
   toString() => NAME;
 }
\ No newline at end of file
diff --git a/pkg/intl/lib/src/date_format_helpers.dart b/pkg/intl/lib/src/date_format_helpers.dart
index 73de780..0cd04de 100644
--- a/pkg/intl/lib/src/date_format_helpers.dart
+++ b/pkg/intl/lib/src/date_format_helpers.dart
@@ -36,15 +36,25 @@
   Date asDate() {
     // TODO(alanknight): Validate the date, especially for things which
     // can crash the VM, e.g. large month values.
-    return new Date(
-        year,
-        month,
-        day,
-        pm ? hour + 12 : hour,
-        minute,
-        second,
-        fractionalSecond,
-        utc);
+    if (utc) {
+      return new Date.utc(
+          year,
+          month,
+          day,
+          pm ? hour + 12 : hour,
+          minute,
+          second,
+          fractionalSecond);
+    } else {
+      return new Date(
+          year,
+          month,
+          day,
+          pm ? hour + 12 : hour,
+          minute,
+          second,
+          fractionalSecond);
+    }
   }
 }
 
diff --git a/pkg/intl/test/bidi_format_test.dart b/pkg/intl/test/bidi_format_test.dart
index 9a62ed7..1aa77ab 100644
--- a/pkg/intl/test/bidi_format_test.dart
+++ b/pkg/intl/test/bidi_format_test.dart
@@ -42,50 +42,50 @@
 
     // Text contains HTML or HTML-escaping.
     expect(ltrFmt.estimateDirection(
-        '<some sort of tag/>$he &amp;', false), equals(LTR));
+        '<some sort of tag/>$he &amp;', isHtml: false), equals(LTR));
     expect(ltrFmt.estimateDirection(
-        '<some sort of tag/>$he &amp;', true), equals(RTL));
+        '<some sort of tag/>$he &amp;', isHtml: true), equals(RTL));
   });
 
   test('wrapWithSpan', () {
     // Test overall dir matches context dir (LTR), no dirReset.
-    expect(ltrFmt.wrapWithSpan(en, true, false), equals(en));
+    expect(ltrFmt.wrapWithSpan(en, isHtml: true, resetDir: false), equals(en));
     // Test overall dir matches context dir (LTR), dirReset.
-    expect(ltrFmt.wrapWithSpan(en, true, true), equals(en));
+    expect(ltrFmt.wrapWithSpan(en, isHtml: true, resetDir: true), equals(en));
     // Test overall dir matches context dir (RTL), no dirReset'.
-    expect(rtlFmt.wrapWithSpan(he, true, false), equals(he));
+    expect(rtlFmt.wrapWithSpan(he, isHtml: true, resetDir: false), equals(he));
     // Test overall dir matches context dir (RTL), dirReset.
-    expect(rtlFmt.wrapWithSpan(he, true, true), equals(he));
+    expect(rtlFmt.wrapWithSpan(he, isHtml: true, resetDir: true), equals(he));
     // Test overall dir (RTL) doesn't match context dir (LTR), no dirReset.
-    expect(ltrFmt.wrapWithSpan(he, true, false),
+    expect(ltrFmt.wrapWithSpan(he, isHtml: true, resetDir: false),
         equals('<span dir=rtl>$he</span>'));
     // Test overall dir (RTL) doesn't match context dir (LTR), dirReset.
-    expect(ltrFmt.wrapWithSpan(he, true, true),
+    expect(ltrFmt.wrapWithSpan(he, isHtml: true, resetDir: true),
         equals('<span dir=rtl>$he</span>$LRM'));
     // Test overall dir (LTR) doesn't match context dir (RTL), no dirReset.
-    expect(rtlFmt.wrapWithSpan(en, true, false),
+    expect(rtlFmt.wrapWithSpan(en, isHtml: true, resetDir: false),
         equals('<span dir=ltr>$en</span>'));
     // Test overall dir (LTR) doesn't match context dir (RTL), dirReset.
-    expect(rtlFmt.wrapWithSpan(en, true, true),
+    expect(rtlFmt.wrapWithSpan(en, isHtml: true, resetDir: true),
         equals('<span dir=ltr>$en</span>$RLM'));
     // Test overall dir (LTR) doesn't match context dir (unknown), no dirReset.
-    expect(unkFmt.wrapWithSpan(en, true, false),
+    expect(unkFmt.wrapWithSpan(en, isHtml: true, resetDir: false),
         equals('<span dir=ltr>$en</span>'));
     // Test overall dir (RTL) doesn't match context dir (unknown), dirReset.
-    expect(unkFmt.wrapWithSpan(he, true, true),
+    expect(unkFmt.wrapWithSpan(he, isHtml: true, resetDir: true),
         equals('<span dir=rtl>$he</span>'));
     // Test overall dir (neutral) doesn't match context dir (LTR), dirReset.
-    expect(ltrFmt.wrapWithSpan('', true, true), equals(''));
+    expect(ltrFmt.wrapWithSpan('', isHtml: true, resetDir: true), equals(''));
 
     // Test exit dir (but not overall dir) is opposite to context dir, dirReset.
-    expect(ltrFmt.wrapWithSpan('$longEn$he$html', true, true),
+    expect(ltrFmt.wrapWithSpan('$longEn$he$html', isHtml: true, resetDir: true),
         equals('$longEn$he$html$LRM'));
     // Test overall dir (but not exit dir) is opposite to context dir, dirReset.
-    expect(rtlFmt.wrapWithSpan('$longEn$he', true, true),
+    expect(rtlFmt.wrapWithSpan('$longEn$he', isHtml: true, resetDir: true),
         equals('<span dir=ltr>$longEn$he</span>$RLM'));
 
     // Test input is plain text (not escaped).
-    expect(ltrFmt.wrapWithSpan('<br>$en', false, false),
+    expect(ltrFmt.wrapWithSpan('<br>$en', isHtml: false, resetDir: false),
         equals('&lt;br&gt;$en'));
 
     var ltrAlwaysSpanFmt = new BidiFormatter.LTR(true);
@@ -93,29 +93,29 @@
     var unkAlwaysSpanFmt = new BidiFormatter.UNKNOWN(true);
 
     // Test alwaysSpan, overall dir matches context dir (LTR), no dirReset.
-    expect(ltrAlwaysSpanFmt.wrapWithSpan(en, true, false),
+    expect(ltrAlwaysSpanFmt.wrapWithSpan(en, isHtml: true, resetDir: false),
         equals('<span>$en</span>'));
     // Test alwaysSpan, overall dir matches context dir (LTR), dirReset.
-    expect(ltrAlwaysSpanFmt.wrapWithSpan(en, true, true),
+    expect(ltrAlwaysSpanFmt.wrapWithSpan(en, isHtml: true, resetDir: true),
         equals('<span>$en</span>'));
     // Test alwaysSpan, overall dir matches context dir (RTL), no dirReset.
-    expect(rtlAlwaysSpanFmt.wrapWithSpan(he, true, false),
+    expect(rtlAlwaysSpanFmt.wrapWithSpan(he, isHtml: true, resetDir: false),
         equals('<span>$he</span>'));
     // Test alwaysSpan, overall dir matches context dir (RTL), dirReset.
-    expect(rtlAlwaysSpanFmt.wrapWithSpan(he, true, true),
+    expect(rtlAlwaysSpanFmt.wrapWithSpan(he, isHtml: true, resetDir: true),
         equals('<span>$he</span>'));
 
     // Test alwaysSpan, overall dir (RTL) doesn't match context dir (LTR),
     // no dirReset.
-    expect(ltrAlwaysSpanFmt.wrapWithSpan(he, true, false),
+    expect(ltrAlwaysSpanFmt.wrapWithSpan(he, isHtml: true, resetDir: false),
         equals('<span dir=rtl>$he</span>'));
     // Test alwaysSpan, overall dir (RTL) doesn't match context dir (LTR),
     // dirReset.
-    expect(ltrAlwaysSpanFmt.wrapWithSpan(he, true, true),
+    expect(ltrAlwaysSpanFmt.wrapWithSpan(he, isHtml: true, resetDir: true),
         equals('<span dir=rtl>$he</span>$LRM'));
     // Test alwaysSpan, overall dir (neutral) doesn't match context dir (LTR),
     // dirReset
-    expect(ltrAlwaysSpanFmt.wrapWithSpan('', true, true),
+    expect(ltrAlwaysSpanFmt.wrapWithSpan('', isHtml: true, resetDir: true),
         equals('<span></span>'));
 
     // Test overall dir matches context dir (LTR.
@@ -151,34 +151,45 @@
 
   test('wrapWithUnicode', () {
     // Test overall dir matches context dir (LTR), no dirReset.
-    expect(ltrFmt.wrapWithUnicode(en, true, false), equals(en));
+    expect(ltrFmt.wrapWithUnicode(en, isHtml: true, resetDir: false),
+        equals(en));
     // Test overall dir matches context dir (LTR), dirReset.
-    expect(ltrFmt.wrapWithUnicode(en, true, true), equals(en));
+    expect(ltrFmt.wrapWithUnicode(en, isHtml: true, resetDir: true),
+        equals(en));
     // Test overall dir matches context dir (RTL), no dirReset.
-    expect(rtlFmt.wrapWithUnicode(he, true, false), equals(he));
+    expect(rtlFmt.wrapWithUnicode(he, isHtml: true, resetDir: false),
+        equals(he));
     // Test overall dir matches context dir (RTL), dirReset.
-    expect(rtlFmt.wrapWithUnicode(he, true, true), equals(he));
+    expect(rtlFmt.wrapWithUnicode(he, isHtml: true, resetDir: true),
+        equals(he));
 
     // Test overall dir (RTL) doesn't match context dir (LTR), no dirReset.
-    expect(ltrFmt.wrapWithUnicode(he, true, false), equals('$RLE$he$PDF'));
+    expect(ltrFmt.wrapWithUnicode(he, isHtml: true, resetDir: false),
+        equals('$RLE$he$PDF'));
     // Test overall dir (RTL) doesn't match context dir (LTR), dirReset.
-    expect(ltrFmt.wrapWithUnicode(he, true, true), equals('$RLE$he$PDF$LRM'));
+    expect(ltrFmt.wrapWithUnicode(he, isHtml: true, resetDir: true),
+        equals('$RLE$he$PDF$LRM'));
     // Test overall dir (LTR) doesn't match context dir (RTL), no dirReset.
-    expect(rtlFmt.wrapWithUnicode(en, true, false), equals('$LRE$en$PDF'));
+    expect(rtlFmt.wrapWithUnicode(en, isHtml: true, resetDir: false),
+        equals('$LRE$en$PDF'));
     // Test overall dir (LTR) doesn't match context dir (RTL), dirReset.
-    expect(rtlFmt.wrapWithUnicode(en, true, true), equals('$LRE$en$PDF$RLM'));
+    expect(rtlFmt.wrapWithUnicode(en, isHtml: true, resetDir: true),
+        equals('$LRE$en$PDF$RLM'));
     // Test overall dir (LTR) doesn't match context dir (unknown), no dirReset.
-    expect(unkFmt.wrapWithUnicode(en, true, false), equals('$LRE$en$PDF'));
+    expect(unkFmt.wrapWithUnicode(en, isHtml: true, resetDir: false),
+        equals('$LRE$en$PDF'));
     // Test overall dir (RTL) doesn't match context dir (unknown), dirReset.
-    expect(unkFmt.wrapWithUnicode(he, true, true), equals('$RLE$he$PDF'));
+    expect(unkFmt.wrapWithUnicode(he, isHtml: true, resetDir: true),
+        equals('$RLE$he$PDF'));
     // Test overall dir (neutral) doesn't match context dir (LTR), dirReset.
-    expect(ltrFmt.wrapWithUnicode('', true, true), equals(''));
+    expect(ltrFmt.wrapWithUnicode('', isHtml: true, resetDir: true),
+        equals(''));
 
     // Test exit dir (but not overall dir) is opposite to context dir, dirReset.
-    expect(ltrFmt.wrapWithUnicode('$longEn$he$html', true, true),
-        equals('$longEn$he$html$LRM'));
+    expect(ltrFmt.wrapWithUnicode('$longEn$he$html', isHtml: true,
+        resetDir: true), equals('$longEn$he$html$LRM'));
     // Test overall dir (but not exit dir) is opposite to context dir, dirReset.
-    expect(rtlFmt.wrapWithUnicode('$longEn$he', true, true),
+    expect(rtlFmt.wrapWithUnicode('$longEn$he', isHtml: true, resetDir: true),
         equals('$LRE$longEn$he$PDF$RLM'));
 
     // Test overall dir matches context dir (LTR).
diff --git a/pkg/intl/test/bidi_utils_test.dart b/pkg/intl/test/bidi_utils_test.dart
index 373d30e4..027e54c 100644
--- a/pkg/intl/test/bidi_utils_test.dart
+++ b/pkg/intl/test/bidi_utils_test.dart
@@ -185,27 +185,28 @@
   });
 
   test('estimateDirectionOfText', () {
-    expect(Bidi.estimateDirectionOfText('', false).value,
+    expect(Bidi.estimateDirectionOfText('', isHtml: false).value,
         equals(TextDirection.UNKNOWN.value));
-    expect(Bidi.estimateDirectionOfText(' ', false).value,
+    expect(Bidi.estimateDirectionOfText(' ', isHtml: false).value,
         equals(TextDirection.UNKNOWN.value));
-    expect(Bidi.estimateDirectionOfText('! (...)', false).value,
+    expect(Bidi.estimateDirectionOfText('! (...)', isHtml: false).value,
         equals(TextDirection.UNKNOWN.value));
-    expect(Bidi.estimateDirectionOfText('All-Ascii content', false).value,
+    expect(Bidi.estimateDirectionOfText('All-Ascii content',
+                                        isHtml: false).value,
         equals(TextDirection.LTR.value));
-    expect(Bidi.estimateDirectionOfText('-17.0%', false).value,
+    expect(Bidi.estimateDirectionOfText('-17.0%', isHtml: false).value,
         equals(TextDirection.LTR.value));
-    expect(Bidi.estimateDirectionOfText('http://foo/bar/', false).value,
+    expect(Bidi.estimateDirectionOfText('http://foo/bar/', isHtml: false).value,
         equals(TextDirection.LTR.value));
     expect(Bidi.estimateDirectionOfText(
         'http://foo/bar/?s=\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0'
         '\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0\u05d0'
         '\u05d0\u05d0\u05d0\u05d0\u05d0').value,
         equals(TextDirection.LTR.value));
-    expect(Bidi.estimateDirectionOfText('\u05d0', false).value,
+    expect(Bidi.estimateDirectionOfText('\u05d0', isHtml: false).value,
         equals(TextDirection.RTL.value));
     expect(Bidi.estimateDirectionOfText(
-        '9 \u05d0 -> 17.5, 23, 45, 19', false).value,
+        '9 \u05d0 -> 17.5, 23, 45, 19', isHtml: false).value,
         equals(TextDirection.RTL.value));
     expect(Bidi.estimateDirectionOfText(
         'http://foo/bar/ \u05d0 http://foo2/bar2/ http://foo3/bar3/').value,
@@ -229,7 +230,7 @@
         '\u05dc\u05d4\u05e1\u05ea\u05db\u05dc \u05e2\u05dc \u05db\u05de\u05d4 '
         '\u05ea\u05de\u05d5\u05e0\u05d5\u05ea \u05de\u05e9\u05e9\u05e2\u05d5'
         '\u05ea \u05d9\u05e9\u05e0\u05d5 \u05d9\u05d5\u05ea\u05e8 \u05e9\u05d9'
-        '\u05e9 \u05dc\u05d9 \u05d1\u05d0\u05ea\u05e8', false).value,
+        '\u05e9 \u05dc\u05d9 \u05d1\u05d0\u05ea\u05e8', isHtml: false).value,
         equals(TextDirection.RTL.value));
     expect(Bidi.estimateDirectionOfText(
         'CAPTCHA \u05de\u05e9\u05d5\u05db\u05dc\u05dc '
@@ -247,7 +248,7 @@
         equals(TextDirection.RTL.value));
     expect(Bidi.estimateDirectionOfText(
         '5710 5720 5730. \u05d4\u05d3\u05dc\u05ea. \u05d4\u05e0\u05e9\u05d9'
-        '\u05e7\u05d4', false).value,
+        '\u05e7\u05d4', isHtml: false).value,
         equals(TextDirection.RTL.value));
     expect(Bidi.estimateDirectionOfText(
         '\u05d4\u05d3\u05dc\u05ea http://www.google.com '
@@ -263,7 +264,7 @@
         '\u05d4\u05d3\u05dc\u05ea &amp; &lt; &gt;').value,
         equals(TextDirection.LTR.value));
     expect(Bidi.estimateDirectionOfText(
-        '\u05d4\u05d3\u05dc\u05ea &amp; &lt; &gt;', true).value,
+        '\u05d4\u05d3\u05dc\u05ea &amp; &lt; &gt;', isHtml: true).value,
         equals(TextDirection.RTL.value));
   });
 
@@ -325,7 +326,7 @@
 
     for (var i = 0; i < bidiText.length; i++) {
         var isRtlDir = Bidi.detectRtlDirectionality(bidiText[i].text,
-                                                            bidiText[i].isHtml);
+                                                    isHtml: bidiText[i].isHtml);
       if (isRtlDir != bidiText[i].isRtl) {
         var str = '"${bidiText[i].text} " should be '
                   '${bidiText[i].isRtl ? "rtl" : "ltr"} but detected as '
diff --git a/pkg/intl/test/date_time_format_test_core.dart b/pkg/intl/test/date_time_format_test_core.dart
index 9504b7e..3920d39 100644
--- a/pkg/intl/test/date_time_format_test_core.dart
+++ b/pkg/intl/test/date_time_format_test_core.dart
@@ -225,7 +225,7 @@
   });
 
   test('Test ALL the supported formats on representative locales', () {
-    var aDate = new Date(2012, 1, 27, 20, 58, 59, 0, false);
+    var aDate = new Date(2012, 1, 27, 20, 58, 59, 0);
     testLocale("en_US", English, aDate);
     testLocale("de_DE", German, aDate);
     testLocale("fr_FR", French, aDate);
@@ -240,11 +240,11 @@
     var locales = subset == null ? allLocales() : subset;
     for (var locale in locales) {
       for (var month in months) {
-        var aDate = new Date(2012, month, 27, 13, 58, 59, 012, false);
+        var aDate = new Date(2012, month, 27, 13, 58, 59, 012);
         testRoundTripParsing(locale, aDate);
       }
       for (var hour in hours) {
-        var aDate = new Date(2012, 1, 27, hour, 58, 59, 123, false);
+        var aDate = new Date(2012, 1, 27, hour, 58, 59, 123);
         testRoundTripParsing(locale, aDate);
       }
     }
@@ -264,7 +264,7 @@
   });
 
   test('Test malformed locales', () {
-    var aDate = new Date(2012, 1, 27, 20, 58, 59, 0, false);
+    var aDate = new Date(2012, 1, 27, 20, 58, 59, 0);
     // Austrian is a useful test locale here because it differs slightly
     // from the generic "de" locale so we can tell the difference between
     // correcting to "de_AT" and falling back to just "de".
@@ -278,14 +278,14 @@
     var instanceJP = intl.date('jms');
     var instanceUS = intl.date('jms', 'en_US');
     var blank = intl.date('jms');
-    var date = new Date(2012, 1, 27, 20, 58, 59, 0, false);
+    var date = new Date(2012, 1, 27, 20, 58, 59, 0);
     expect(instanceJP.format(date), equals("20:58:59"));
     expect(instanceUS.format(date), equals("8:58:59 PM"));
     expect(blank.format(date), equals("20:58:59"));
   });
 
   test('Test explicit format string', () {
-    var aDate = new Date(2012, 1, 27, 20, 58, 59, 0, false);
+    var aDate = new Date(2012, 1, 27, 20, 58, 59, 0);
     // An explicit format that doesn't conform to any skeleton
     var us = new DateFormat(r'yy //// :D \\\\ dd:ss ^&@ M');
     expect(us.format(aDate), equals(r"12 //// :D \\\\ 27:59 ^&@ 1"));
@@ -309,8 +309,8 @@
     });
 
   test('Test fractional seconds padding', () {
-    var one = new Date(2012, 1, 27, 20, 58, 59, 1, false);
-    var oneHundred = new Date(2012, 1, 27, 20, 58, 59, 100, false);
+    var one = new Date(2012, 1, 27, 20, 58, 59, 1);
+    var oneHundred = new Date(2012, 1, 27, 20, 58, 59, 100);
     var fractional = new DateFormat('hh:mm:ss.SSS', 'en_US');
     expect(fractional.format(one), equals('08:58:59.001'));
     expect(fractional.format(oneHundred), equals('08:58:59.100'));
@@ -320,8 +320,8 @@
   });
 
   test('Test parseUTC', () {
-    var local = new Date(2012, 1, 27, 20, 58, 59, 1, false);
-    var utc = new Date(2012, 1, 27, 20, 58, 59, 1, true);
+    var local = new Date(2012, 1, 27, 20, 58, 59, 1);
+    var utc = new Date.utc(2012, 1, 27, 20, 58, 59, 1);
     // Getting the offset as a duration via difference() would be simpler,
     // but doesn't work on dart2js in checked mode. See issue 4437.
     var offset = utc.millisecondsSinceEpoch - local.millisecondsSinceEpoch;
@@ -337,8 +337,8 @@
     });
 
   test('Test default format', () {
-    var someDate = new Date(2012, 1, 27, 20, 58, 59, 1, false);
-    var emptyFormat = new DateFormat(locale: "en_US");
+    var someDate = new Date(2012, 1, 27, 20, 58, 59, 1);
+    var emptyFormat = new DateFormat(null, "en_US");
     var knownDefault = new DateFormat.yMMMMd("en_US").add_jms();
     var result = emptyFormat.format(someDate);
     var knownResult = knownDefault.format(someDate);
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 0003c70..d1ebf16 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -43,6 +43,7 @@
 [ $compiler == dartc ]
 unittest/test/mock_regexp_negative_test: Fail
 unittest/test/mock_stepwise_negative_test: Fail
+dartdoc/test/dartdoc_test: Fail # http://dartbug.com/6073
 
 [ $compiler == dart2js || $compiler == dartc ]
 unittest/test/instance_test: Skip
diff --git a/pkg/unittest/core_matchers.dart b/pkg/unittest/core_matchers.dart
index c996eea..9d9d172 100644
--- a/pkg/unittest/core_matchers.dart
+++ b/pkg/unittest/core_matchers.dart
@@ -280,7 +280,7 @@
       // completes.
       item.onComplete(expectAsync1((future) {
         if (future.hasValue) {
-          expect(false, reason:
+          expect(false, isTrue,
               "Expected future to fail, but succeeded with '${future.value}'.");
         } else if (_matcher != null) {
           var reason;
@@ -289,7 +289,7 @@
             stackTrace = "  ${stackTrace.replaceAll("\n", "\n  ")}";
             reason = "Actual exception trace:\n$stackTrace";
           }
-          expect(future.exception, _matcher, reason: reason);
+          expect(future.exception, _matcher, reason);
         }
       }));
 
@@ -610,7 +610,7 @@
  * Returns a matcher that uses an arbitrary function that returns
  * true or false for the actual value.
  */
-Matcher predicate(f, [description = 'satisfies function']) =>
+Matcher predicate(f, {description: 'satisfies function'}) =>
     new _Predicate(f, description);
 
 class _Predicate extends BaseMatcher {
diff --git a/pkg/unittest/future_matchers.dart b/pkg/unittest/future_matchers.dart
index bb3a3c0..c72037e 100644
--- a/pkg/unittest/future_matchers.dart
+++ b/pkg/unittest/future_matchers.dart
@@ -41,7 +41,7 @@
         reason = '$reason\nStack trace:\n$stackTrace';
       }
 
-      expect(future.hasValue, reason: reason);
+      expect(future.hasValue, isTrue, reason);
       if (_matcher != null) expect(future.value, _matcher);
     }));
 
diff --git a/pkg/unittest/mock.dart b/pkg/unittest/mock.dart
index aad857f..ded68f3 100644
--- a/pkg/unittest/mock.dart
+++ b/pkg/unittest/mock.dart
@@ -829,10 +829,10 @@
    *         distance: 3).toString());
    */
   LogEntryList preceding(LogEntryList keys,
-                         [mockNameFilter = null,
-                         logFilter = null,
-                         int distance = 1,
-                         bool includeKeys = false]) =>
+                         {mockNameFilter: null,
+                         logFilter: null,
+                         int distance: 1,
+                         bool includeKeys: false}) =>
       _neighboring(true, keys, mockNameFilter, logFilter,
           distance, includeKeys);
 
@@ -846,10 +846,10 @@
    * See [preceding] for a usage example.
    */
   LogEntryList following(LogEntryList keys,
-                         [mockNameFilter = null,
-                         logFilter = null,
-                         int distance = 1,
-                         bool includeKeys = false]) =>
+                         {mockNameFilter: null,
+                         logFilter: null,
+                         int distance: 1,
+                         bool includeKeys: false}) =>
       _neighboring(false, keys, mockNameFilter, logFilter,
           distance, includeKeys);
 }
@@ -1236,10 +1236,10 @@
    * If [enableLogging] is false, no logging will be done initially (whether
    * or not a [log] is supplied), but [logging] can be set to true later.
    */
-  Mock.custom([this.name,
+  Mock.custom({this.name,
                this.log,
-               throwIfNoBehavior = false,
-               enableLogging = true]) : _throwIfNoBehavior = throwIfNoBehavior {
+               throwIfNoBehavior: false,
+               enableLogging: true}) : _throwIfNoBehavior = throwIfNoBehavior {
     if (log != null && name == null) {
       throw new Exception("Mocks with shared logs must have a name.");
     }
diff --git a/pkg/unittest/test/matchers_test.dart b/pkg/unittest/test/matchers_test.dart
index 90501d6..11bdcc2 100644
--- a/pkg/unittest/test/matchers_test.dart
+++ b/pkg/unittest/test/matchers_test.dart
@@ -517,9 +517,11 @@
 
   group('Predicate Matchers', () {
     test('isInstanceOf', () {
-      shouldFail(0, predicate((x) => x is String, "an instance of String"),
-        "Expected: an instance of String but: was <0>.");
-      shouldPass('cow', predicate((x) => x is String, "an instance of String"));
+      shouldFail(0, predicate((x) => x is String,
+                              description: "an instance of String"),
+          "Expected: an instance of String but: was <0>.");
+      shouldPass('cow', predicate((x) => x is String,
+                                  description: "an instance of String"));
     });
   });
 }
diff --git a/pkg/unittest/test/mock_test.dart b/pkg/unittest/test/mock_test.dart
index c70784d..ea6426c 100644
--- a/pkg/unittest/test/mock_test.dart
+++ b/pkg/unittest/test/mock_test.dart
@@ -23,7 +23,7 @@
 makeTestLogEntry(String methodName, List args, int time,
                  [String mockName]) {
   LogEntry e = new LogEntry(mockName, methodName, args, Action.IGNORE);
-  e.time = new Date.fromMillisecondsSinceEpoch(time, true);
+  e.time = new Date.fromMillisecondsSinceEpoch(time, isUtc: true);
   return e;
 }
 
@@ -219,11 +219,11 @@
   test('Mocking: from,after,before,until', () {
     LogEntryList logList = makeTestLog();
     LogEntryList log2;
-    Date t0 = new Date.fromMillisecondsSinceEpoch(0, true);
-    Date t1000 = new Date.fromMillisecondsSinceEpoch(1000, true);
-    Date t2000 = new Date.fromMillisecondsSinceEpoch(2000, true);
-    Date t3000 = new Date.fromMillisecondsSinceEpoch(3000, true);
-    Date t4000 = new Date.fromMillisecondsSinceEpoch(4000, true);
+    Date t0 = new Date.fromMillisecondsSinceEpoch(0, isUtc: true);
+    Date t1000 = new Date.fromMillisecondsSinceEpoch(1000, isUtc: true);
+    Date t2000 = new Date.fromMillisecondsSinceEpoch(2000, isUtc: true);
+    Date t3000 = new Date.fromMillisecondsSinceEpoch(3000, isUtc: true);
+    Date t4000 = new Date.fromMillisecondsSinceEpoch(4000, isUtc: true);
 
     log2 = logList.before(t0);
     expect(log2.logs, hasLength(0));
@@ -305,11 +305,11 @@
   });
 
   test('Mocking: inplace from,after,before,until', () {
-    Date t0 = new Date.fromMillisecondsSinceEpoch(0, true);
-    Date t1000 = new Date.fromMillisecondsSinceEpoch(1000, true);
-    Date t2000 = new Date.fromMillisecondsSinceEpoch(2000, true);
-    Date t3000 = new Date.fromMillisecondsSinceEpoch(3000, true);
-    Date t4000 = new Date.fromMillisecondsSinceEpoch(4000, true);
+    Date t0 = new Date.fromMillisecondsSinceEpoch(0, isUtc: true);
+    Date t1000 = new Date.fromMillisecondsSinceEpoch(1000, isUtc: true);
+    Date t2000 = new Date.fromMillisecondsSinceEpoch(2000, isUtc: true);
+    Date t3000 = new Date.fromMillisecondsSinceEpoch(3000, isUtc: true);
+    Date t4000 = new Date.fromMillisecondsSinceEpoch(4000, isUtc: true);
 
     LogEntryList logList = makeTestLog().before(t0, true);
     expect(logList.logs, hasLength(0));
@@ -471,12 +471,12 @@
         distance:3, includeKeys:true);
     expect(result.logs, orderedEquals([e1, e2, e3]));
 
-    result = logList.preceding(keyList, equals('a'), callsTo(startsWith('bar')),
-      distance:3);
+    result = logList.preceding(keyList, mockNameFilter: equals('a'),
+        logFilter: callsTo(startsWith('bar')), distance:3);
     expect(result.logs, orderedEquals([e1]));
 
-    result = logList.preceding(keyList, equals('a'), callsTo(startsWith('bar')),
-        distance:3, includeKeys:true);
+    result = logList.preceding(keyList, mockNameFilter: equals('a'),
+        logFilter: callsTo(startsWith('bar')), distance:3, includeKeys:true);
     expect(result.logs, orderedEquals([e1, e3]));
 
     keyList.logs.clear();
diff --git a/pkg/unittest/test/unittest_test.dart b/pkg/unittest/test/unittest_test.dart
index 1905566..ba85f39 100644
--- a/pkg/unittest/test/unittest_test.dart
+++ b/pkg/unittest/test/unittest_test.dart
@@ -31,10 +31,10 @@
 
 String buildStatusString(int passed, int failed, int errors,
                          var results,
-                         [int count = 0,
-                         String setup = '', String teardown = '',
-                         String uncaughtError = null,
-                         String message = '']) {
+                         {int count: 0,
+                         String setup: '', String teardown: '',
+                         String uncaughtError: null,
+                         String message: ''}) {
   var totalTests = 0;
   String testDetails = '';
   if (results is String) {
@@ -66,8 +66,9 @@
 
   void onDone(int passed, int failed, int errors, List<TestCase> results,
       String uncaughtError) {
-    var result = buildStatusString(passed, failed, errors, results, count,
-        setup, teardown, uncaughtError);
+    var result = buildStatusString(passed, failed, errors, results,
+        count: count, setup: setup, teardown: teardown,
+        uncaughtError: uncaughtError);
     _port.send(result);
   }
 }
@@ -190,14 +191,15 @@
         message: 'Expected: <5> but: was <4>.'),
     buildStatusString(0, 1, 0, tests[2], message: 'Caught Exception: Fail.'),
     buildStatusString(2, 0, 0, 'a a::a b b'),
-    buildStatusString(1, 0, 0, 'a ${tests[4]}', 0, 'setup'),
-    buildStatusString(1, 0, 0, 'a ${tests[5]}', 0, '', 'teardown'),
-    buildStatusString(1, 0, 0, 'a ${tests[6]}', 0,
-        'setup', 'teardown'),
-    buildStatusString(1, 0, 0, tests[7], 1),
-    buildStatusString(0, 0, 1, tests[8], 1,
+    buildStatusString(1, 0, 0, 'a ${tests[4]}', count: 0, setup: 'setup'),
+    buildStatusString(1, 0, 0, 'a ${tests[5]}', count: 0, setup: '',
+        teardown: 'teardown'),
+    buildStatusString(1, 0, 0, 'a ${tests[6]}', count: 0,
+        setup: 'setup', teardown: 'teardown'),
+    buildStatusString(1, 0, 0, tests[7], count: 1),
+    buildStatusString(0, 0, 1, tests[8], count: 1,
         message: 'Callback called more times than expected (2 > 1).'),
-    buildStatusString(1, 0, 0, tests[9], 10),
+    buildStatusString(1, 0, 0, tests[9], count: 10),
     buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'),
     buildStatusString(1, 0, 1, 'testOne', message: 'Callback called after already being marked as done (1).:testTwo:'),
     buildStatusString(2, 1, 0, 'testOne::testTwo:Expected: false but: was <true>.:testThree')
diff --git a/pkg/unittest/unittest.dart b/pkg/unittest/unittest.dart
index f8bb101..29a18c8 100644
--- a/pkg/unittest/unittest.dart
+++ b/pkg/unittest/unittest.dart
@@ -481,7 +481,7 @@
 
 /** Like [expectAsync0] but [callback] should take 1 positional argument. */
 // TODO(sigmund): deprecate this API when issue 2706 is fixed.
-Function expectAsync1(Function callback, [int count = 1]) {
+Function expectAsync1(Function callback, {int count: 1}) {
   return new _SpreadArgsHelper.fixedCallCount(callback, count).invoke1;
 }
 
@@ -797,7 +797,7 @@
       if (!testCase.isComplete && testCase.callbackFunctionsOutstanding == 0) {
         testCase.pass();
       }
-    }, testNum:_currentTest);
+    }, null, _currentTest);
 
     if (!testCase.isComplete &&
         testCase.callbackFunctionsOutstanding > 0) return;
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 35dadfc..3e40dede 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -343,17 +343,12 @@
 
 
 Dart_Handle DartUtils::LoadScript(const char* script_uri,
-                                  bool resolve_script,
                                   Dart_Handle builtin_lib) {
   Dart_Handle resolved_script_uri;
-  if (resolve_script) {
-    resolved_script_uri = ResolveScriptUri(Dart_NewString(script_uri),
-                                           builtin_lib);
-    if (Dart_IsError(resolved_script_uri)) {
-      return resolved_script_uri;
-    }
-  } else {
-    resolved_script_uri = Dart_NewString(script_uri);
+  resolved_script_uri = ResolveScriptUri(Dart_NewString(script_uri),
+                                         builtin_lib);
+  if (Dart_IsError(resolved_script_uri)) {
+    return resolved_script_uri;
   }
   Dart_Handle source = ReadSource(resolved_script_uri, builtin_lib);
   if (Dart_IsError(source)) {
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index 27e4e26..57f168f 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -93,7 +93,6 @@
                                        Dart_Handle library,
                                        Dart_Handle url);
   static Dart_Handle LoadScript(const char* script_uri,
-                                bool resolve_script,
                                 Dart_Handle builtin_lib);
   static Dart_Handle LoadSource(CommandLineOptions* url_mapping,
                                 Dart_Handle library,
diff --git a/runtime/bin/dbg_connection.cc b/runtime/bin/dbg_connection.cc
index 5b398fd..4c23dd4 100644
--- a/runtime/bin/dbg_connection.cc
+++ b/runtime/bin/dbg_connection.cc
@@ -224,11 +224,13 @@
       int32_t cmd_idx = DbgMsgQueueList::LookupIsolateCommand(r.ValueChars(),
                                                               r.ValueLen());
       if (cmd_idx != DbgMsgQueueList::kInvalidCommand) {
+        const char* start = msgbuf_->buf();
+        const char* end = r.EndOfObject();
         // Get debug message queue corresponding to isolate.
-        // TODO(asiva): Once we have support for including the isolate id
-        // in the debug wire protocol we need to read the isolate id and
-        // pass it down to AddIsolateMessage.
-        if (!DbgMsgQueueList::AddIsolateMessage(ILLEGAL_ISOLATE_ID,
+        MessageParser msg_parser(start, (end - start));
+        Dart_IsolateId isolate_id =
+            static_cast<Dart_IsolateId>(msg_parser.GetIntParam("isolateId"));
+        if (!DbgMsgQueueList::AddIsolateMessage(isolate_id,
                                                 cmd_idx,
                                                 msgbuf_->buf(),
                                                 r.EndOfObject(),
diff --git a/runtime/bin/dbg_connection_android.cc b/runtime/bin/dbg_connection_android.cc
index d5a8f1d..7fe7e94 100644
--- a/runtime/bin/dbg_connection_android.cc
+++ b/runtime/bin/dbg_connection_android.cc
@@ -28,11 +28,11 @@
     DebuggerConnectionHandler::AcceptDbgConnection(fd);
     // TODO(hausner): add the debugger wire socket fd to the event poll queue
     // once we poll the debugger connection.
-  } else if (event->data.fd == DebuggerConnectionHandler::debugger_fd_) {
-    printf("unexpected: receiving debugger connection event.\n");
+  } else if (event->data.fd == wakeup_fds_[0]) {
+    // Sync message. Not yet implemented.
     UNIMPLEMENTED();
   } else {
-    // Sync message. Not yet implemented.
+    printf("unexpected: receiving debugger connection event.\n");
     UNIMPLEMENTED();
   }
 }
diff --git a/runtime/bin/dbg_message.cc b/runtime/bin/dbg_message.cc
index f0356cf..ae7edf5 100644
--- a/runtime/bin/dbg_message.cc
+++ b/runtime/bin/dbg_message.cc
@@ -997,13 +997,6 @@
     return NULL;  // No items in the list.
   }
 
-  // TODO(asiva): Remove once debug wire protocol has isolate id.
-  // For now we return the first item in the list as we are only supporting
-  // debugging of a single isolate.
-  if (id == ILLEGAL_ISOLATE_ID) {
-    return list_;
-  }
-
   // Find message queue corresponding to isolate id.
   DbgMsgQueue* iterator = list_;
   while (iterator != NULL && iterator->isolate_id() != id) {
diff --git a/runtime/bin/directory.dart b/runtime/bin/directory.dart
index 7263f0b..d7fab76 100644
--- a/runtime/bin/directory.dart
+++ b/runtime/bin/directory.dart
@@ -126,7 +126,7 @@
    * operation. Handlers for files and directories should be
    * registered on this DirectoryLister object.
    */
-  DirectoryLister list([bool recursive = false]);
+  DirectoryLister list({bool recursive: false});
 
   /**
    * Gets the path of this directory.
diff --git a/runtime/bin/directory_impl.dart b/runtime/bin/directory_impl.dart
index 23510f9..f4b43f1 100644
--- a/runtime/bin/directory_impl.dart
+++ b/runtime/bin/directory_impl.dart
@@ -169,7 +169,7 @@
     return new Directory(newPath);
   }
 
-  DirectoryLister list([bool recursive = false]) {
+  DirectoryLister list({bool recursive: false}) {
     return new _DirectoryLister(_path, recursive);
   }
 
diff --git a/runtime/bin/file_impl.dart b/runtime/bin/file_impl.dart
index 5eeb768c..0aa31fb 100644
--- a/runtime/bin/file_impl.dart
+++ b/runtime/bin/file_impl.dart
@@ -99,7 +99,7 @@
     return closed ? 0 : _data.length - _position;
   }
 
-  void pipe(OutputStream output, [bool close = true]) {
+  void pipe(OutputStream output, {bool close: true}) {
     _pipe(this, output, close: close);
   }
 
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 77b98cb..e352a46 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -357,7 +357,6 @@
                                                 snapshot_buffer,
                                                 NULL,
                                                 &error);
-      free(snapshot_buffer);
       if (isolate == NULL) {
         fprintf(stderr, "%s", error);
         free(error);
@@ -380,10 +379,12 @@
       CHECK_RESULT(result);
 
       // Load specified script.
-      library = DartUtils::LoadScript(app_script_name, true, builtin_lib);
+      library = DartUtils::LoadScript(app_script_name, builtin_lib);
 
       // Now create and write snapshot of script.
       CreateAndWriteSnapshot(true);
+
+      free(snapshot_buffer);
     }
   } else {
     SetupForGenericSnapshotCreation();
diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart
index a0d73ba..c8394a7 100644
--- a/runtime/bin/http_impl.dart
+++ b/runtime/bin/http_impl.dart
@@ -1127,7 +1127,7 @@
     return _requestOrResponse._streamAvailable();
   }
 
-  void pipe(OutputStream output, [bool close = true]) {
+  void pipe(OutputStream output, {bool close: true}) {
     _pipe(this, output, close: close);
   }
 
@@ -1448,7 +1448,7 @@
   _HttpServer() : _connections = new Set<_HttpConnection>(),
                   _handlers = new List<_RequestHandlerRegistration>();
 
-  void listen(String host, int port, [int backlog = 128]) {
+  void listen(String host, int port, {int backlog: 128}) {
     listenOn(new ServerSocket(host, port, backlog));
     _closeServer = true;
   }
diff --git a/runtime/bin/http_utils.dart b/runtime/bin/http_utils.dart
index 490c7b3..668ba66 100644
--- a/runtime/bin/http_utils.dart
+++ b/runtime/bin/http_utils.dart
@@ -242,8 +242,7 @@
       expect("GMT");
     }
     expectEnd();
-    return new Date(
-        year, month + 1, day, hours, minutes, seconds, 0, isUtc: true);
+    return new Date.utc(year, month + 1, day, hours, minutes, seconds, 0);
   }
 
   static Date parseCookieDate(String date) {
@@ -353,6 +352,6 @@
     if (minute > 59) error();
     if (second > 59) error();
 
-    return new Date(year, month, dayOfMonth, hour, minute, second, 0, true);
+    return new Date.utc(year, month, dayOfMonth, hour, minute, second, 0);
   }
 }
diff --git a/runtime/bin/list_stream_impl.dart b/runtime/bin/list_stream_impl.dart
index 9061053..1385d6a 100644
--- a/runtime/bin/list_stream_impl.dart
+++ b/runtime/bin/list_stream_impl.dart
@@ -61,7 +61,7 @@
   bool writeFrom(List<int> buffer, [int offset = 0, int len]) {
     return write(
         buffer.getRange(offset, (len == null) ? buffer.length - offset : len),
-        copyBuffer: false);
+        false);
   }
 
   void flush() {
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index d4fe179..df01016 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -399,7 +399,6 @@
 // Returns true on success, false on failure.
 static bool CreateIsolateAndSetupHelper(const char* script_uri,
                                         const char* main,
-                                        bool resolve_script,
                                         void* data,
                                         char** error) {
   Dart_Isolate isolate =
@@ -466,7 +465,7 @@
     result = DartUtils::PrepareForScriptLoading(package_root, builtin_lib);
     CHECK_RESULT(result);
 
-    library = DartUtils::LoadScript(script_uri, resolve_script, builtin_lib);
+    library = DartUtils::LoadScript(script_uri, builtin_lib);
   }
   CHECK_RESULT(library);
   if (!Dart_IsLibrary(library)) {
@@ -489,7 +488,6 @@
                                   void* data, char** error) {
   return CreateIsolateAndSetupHelper(script_uri,
                                      main,
-                                     false,  // script_uri already canonical.
                                      new IsolateData(),
                                      error);
 }
@@ -684,7 +682,6 @@
   char* isolate_name = BuildIsolateName(script_name, "main");
   if (!CreateIsolateAndSetupHelper(script_name,
                                    "main",
-                                   true,  // Canonicalize the script name.
                                    new IsolateData(),
                                    &error)) {
     fprintf(stderr, "%s\n", error);
diff --git a/runtime/bin/process.dart b/runtime/bin/process.dart
index ca6c097..e5a5618 100644
--- a/runtime/bin/process.dart
+++ b/runtime/bin/process.dart
@@ -17,23 +17,19 @@
 class Process {
   /**
    * Starts a process running the [executable] with the specified
-   * [arguments]. Returns a [Process] instance that can be used to
-   * interact with the process.
+   * [arguments]. Returns a [:Future<Process>:] that completes with a
+   * Process instance when the process has been successfully
+   * started. That [Process] object can be used to interact with the
+   * process. If the process cannot be started the returned [Future]
+   * completes with an exception.
    *
    * An optional [ProcessOptions] object can be passed to specify
    * options other than the executable and the arguments.
-   *
-   * When the process has been successfully started [onStart] is
-   * called on the returned Process object. If the process fails to
-   * start [onError] is called on the returned Process object.
-   *
-   * No data can be written to the process stdin and the process
-   * cannot be closed nor killed before [onStart] has been invoked.
    */
-  static Process start(String executable,
-                       List<String> arguments,
-                       [ProcessOptions options]) {
-    return new _Process.start(executable, arguments, options);
+  static Future<Process> start(String executable,
+                               List<String> arguments,
+                               [ProcessOptions options]) {
+    return _Process.start(executable, arguments, options);
   }
 
   /**
@@ -78,12 +74,6 @@
   abstract OutputStream get stdin;
 
   /**
-   * Set the start handler which gets invoked when the process is
-   * successfully started.
-   */
-  abstract void set onStart(void callback());
-
-  /**
    * Sets an exit handler which gets invoked when the process
    * terminates.
    *
@@ -93,18 +83,12 @@
   abstract void set onExit(void callback(int exitCode));
 
   /**
-   * Set an error handler which gets invoked if an operation on the process
-   * fails.
-   */
-  abstract void set onError(void callback(e));
-
-  /**
    * On Windows, [kill] kills the process, ignoring the [signal]
    * flag. On Posix systems, [kill] sends [signal] to the
    * process. Depending on the signal giving, it'll have different
    * meanings. When the process terminates as a result of calling
-   * [kill] [onExit] is called. If the kill operation fails, [onError]
-   * is called.
+   * [kill] [onExit] is called. If the kill operation fails an
+   * exception is thrown.
    */
   abstract void kill([ProcessSignal signal = ProcessSignal.SIGTERM]);
 
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
index 47ccd8d..f05a1f1 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -14,12 +14,17 @@
   static Future<ProcessResult> run(String path,
                                    List<String> arguments,
                                    [ProcessOptions options]) {
-    return new _NonInteractiveProcess._start(path, arguments, options)._result;
+    return new _NonInteractiveProcess(path, arguments, options)._result;
   }
 
-  _Process.start(String path,
-                 List<String> arguments,
-                 ProcessOptions options) {
+  static Future<Process> start(String path,
+                               List<String> arguments,
+                               ProcessOptions options) {
+    _Process process = new _Process(path, arguments, options);
+    return process._start();
+  }
+
+  _Process(String path, List<String> arguments, ProcessOptions options) {
     if (path is !String) {
       throw new ArgumentError("Path is not a String: $path");
     }
@@ -72,9 +77,6 @@
     _ended = false;
     _started = false;
     _onExit = null;
-    // TODO(ager): Make the actual process starting really async instead of
-    // simulating it with a timer.
-    new Timer(0, (Timer ignore) => _start());
   }
 
   String _windowsArgumentEscape(String argument) {
@@ -130,65 +132,69 @@
             (bytes[offset + 3] << 24));
   }
 
-  void _start() {
-    var status = new _ProcessStartStatus();
-    bool success = _startNative(_path,
-                                _arguments,
-                                _workingDirectory,
-                                _environment,
-                                _in,
-                                _out,
-                                _err,
-                                _exitHandler,
-                                status);
-    if (!success) {
-      close();
-      _reportError(new ProcessException(status._errorMessage,
-                                        status._errorCode));
-      return;
-    }
-    _started = true;
-
-    _in._closed = false;
-    _out._closed = false;
-    _err._closed = false;
-    _exitHandler._closed = false;
-
-    // Make sure to activate socket handlers now that the file
-    // descriptors have been set.
-    _in._activateHandlers();
-    _out._activateHandlers();
-    _err._activateHandlers();
-
-    // Setup an exit handler to handle internal cleanup and possible
-    // callback when a process terminates.
-    int exitDataRead = 0;
-    final int EXIT_DATA_SIZE = 8;
-    List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE);
-    _exitHandler.inputStream.onData = () {
-
-      int exitCode(List<int> ints) {
-        var code = _intFromBytes(ints, 0);
-        var negative = _intFromBytes(ints, 4);
-        assert(negative == 0 || negative == 1);
-        return (negative == 0) ? code : -code;
+  Future<Process> _start() {
+    var completer = new Completer();
+    // TODO(ager): Make the actual process starting really async instead of
+    // simulating it with a timer.
+    new Timer(0, (_) {
+      var status = new _ProcessStartStatus();
+      bool success = _startNative(_path,
+                                  _arguments,
+                                  _workingDirectory,
+                                  _environment,
+                                  _in,
+                                  _out,
+                                  _err,
+                                  _exitHandler,
+                                  status);
+      if (!success) {
+        close();
+        completer.completeException(
+            new ProcessException(status._errorMessage, status._errorCode));
+        return;
       }
+      _started = true;
 
-      void handleExit() {
-        _ended = true;
-        if (_onExit !== null) {
-          _onExit(exitCode(exitDataBuffer));
+      _in._closed = false;
+      _out._closed = false;
+      _err._closed = false;
+      _exitHandler._closed = false;
+
+      // Make sure to activate socket handlers now that the file
+      // descriptors have been set.
+      _in._activateHandlers();
+      _out._activateHandlers();
+      _err._activateHandlers();
+
+      // Setup an exit handler to handle internal cleanup and possible
+      // callback when a process terminates.
+      int exitDataRead = 0;
+      final int EXIT_DATA_SIZE = 8;
+      List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE);
+      _exitHandler.inputStream.onData = () {
+
+        int exitCode(List<int> ints) {
+          var code = _intFromBytes(ints, 0);
+          var negative = _intFromBytes(ints, 4);
+          assert(negative == 0 || negative == 1);
+          return (negative == 0) ? code : -code;
         }
-      }
 
-      exitDataRead += _exitHandler.inputStream.readInto(
-          exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead);
-      if (exitDataRead == EXIT_DATA_SIZE) handleExit();
-    };
+        void handleExit() {
+          _ended = true;
+          if (_onExit !== null) {
+            _onExit(exitCode(exitDataBuffer));
+          }
+        }
 
-    if (_onStart !== null) {
-      _onStart();
-    }
+        exitDataRead += _exitHandler.inputStream.readInto(
+            exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead);
+        if (exitDataRead == EXIT_DATA_SIZE) handleExit();
+      };
+
+      completer.complete(this);
+    });
+    return completer.future;
   }
 
   bool _startNative(String path,
@@ -227,19 +233,10 @@
       throw new ArgumentError(
           "Argument 'signal' must be a ProcessSignal");
     }
-    if (!_started) {
-      var e = new ProcessException("Cannot kill process that is not started");
-      _reportError(e);
-      return;
-    }
-    if (_ended) {
-      return;
-    }
-    if (_kill(this, signal._signalNumber)) {
-      return;
-    }
-    _reportError(new ProcessException("Could not kill process"));
-    return;
+    assert(_started);
+    if (_ended) return;
+    if (_kill(this, signal._signalNumber)) return;
+    throw new ProcessException("Could not kill process");
   }
 
   bool _kill(Process p, int signal) native "Process_Kill";
@@ -265,22 +262,6 @@
     _onExit = callback;
   }
 
-  void set onError(void callback(e)) {
-    _onError = callback;
-  }
-
-  void set onStart(void callback()) {
-    _onStart = callback;
-  }
-
-  void _reportError(e) {
-    if (_onError != null) {
-      _onError(e);
-    } else {
-      throw e;
-    }
-  }
-
   String _path;
   List<String> _arguments;
   String _workingDirectory;
@@ -294,8 +275,6 @@
   bool _ended;
   bool _started;
   Function _onExit;
-  Function _onError;
-  Function _onStart;
 }
 
 
@@ -304,9 +283,9 @@
 // _NonInteractiveProcess is used to implement the Process.run
 // method.
 class _NonInteractiveProcess {
-  _NonInteractiveProcess._start(String path,
-                                List<String> arguments,
-                                ProcessOptions options) {
+  _NonInteractiveProcess(String path,
+                         List<String> arguments,
+                         ProcessOptions options) {
     _completer = new Completer<ProcessResult>();
     // Extract output encoding options and verify arguments.
     var stdoutEncoding = Encoding.UTF_8;
@@ -329,43 +308,47 @@
     }
 
     // Start the underlying process.
-    _process = new _Process.start(path, arguments, options);
+    var processFuture = new _Process(path, arguments, options)._start();
 
-    // Make sure stdin is closed.
-    _process.onStart = _process.stdin.close;
+    processFuture.then((Process p) {
+      // Make sure the process stdin is closed.
+      p.stdin.close;
 
-    // Setup process error handling.
-    _process.onError = (e) => _completer.completeException(e);
+      // Setup process exit handling.
+      p.onExit = (exitCode) {
+        _exitCode = exitCode;
+        _checkDone();
+      };
 
-    // Setup process exit handling.
-    _process.onExit = (exitCode) {
-      _exitCode = exitCode;
-      _checkDone();
-    };
+      // Setup stdout handling.
+      _stdoutBuffer = new StringBuffer();
+      var stdoutStream = new StringInputStream(p.stdout, stdoutEncoding);
+      stdoutStream.onData = () {
+        var data = stdoutStream.read();
+        if (data != null) _stdoutBuffer.add(data);
+      };
+      stdoutStream.onClosed = () {
+        _stdoutClosed = true;
+        _checkDone();
+      };
 
-    // Setup stdout handling.
-    _stdoutBuffer = new StringBuffer();
-    var stdoutStream = new StringInputStream(_process.stdout, stdoutEncoding);
-    stdoutStream.onData = () {
-      var data = stdoutStream.read();
-      if (data != null) _stdoutBuffer.add(data);
-    };
-    stdoutStream.onClosed = () {
-      _stdoutClosed = true;
-      _checkDone();
-    };
+      // Setup stderr handling.
+      _stderrBuffer = new StringBuffer();
+      var stderrStream = new StringInputStream(p.stderr, stderrEncoding);
+      stderrStream.onData = () {
+        var data = stderrStream.read();
+        if (data != null) _stderrBuffer.add(data);
+      };
+      stderrStream.onClosed = () {
+        _stderrClosed = true;
+        _checkDone();
+      };
+    });
 
-    // Setup stderr handling.
-    _stderrBuffer = new StringBuffer();
-    var stderrStream = new StringInputStream(_process.stderr, stderrEncoding);
-    stderrStream.onData = () {
-      var data = stderrStream.read();
-      if (data != null) _stderrBuffer.add(data);
-    };
-    stderrStream.onClosed = () {
-      _stderrClosed = true;
-      _checkDone();
-    };
+    processFuture.handleException((error) {
+      _completer.completeException(error);
+      return true;
+    });
   }
 
   void _checkDone() {
@@ -379,7 +362,6 @@
   Future<ProcessResult> get _result => _completer.future;
 
   Completer<ProcessResult> _completer;
-  Process _process;
   StringBuffer _stdoutBuffer;
   StringBuffer _stderrBuffer;
   int _exitCode;
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index 331807b..104fee3 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -515,10 +515,7 @@
     return true;  // The process has already died.  Report a successful kill.
   }
   BOOL result = TerminateProcess(process_handle, -1);
-  if (!result) {
-    return false;
-  }
-  return true;
+  return result ? true : false;
 }
 
 
diff --git a/runtime/bin/socket_stream_impl.dart b/runtime/bin/socket_stream_impl.dart
index 4a40d7e..a2bbf99 100644
--- a/runtime/bin/socket_stream_impl.dart
+++ b/runtime/bin/socket_stream_impl.dart
@@ -45,7 +45,7 @@
 
   int available() => _socket.available();
 
-  void pipe(OutputStream output, [bool close = true]) {
+  void pipe(OutputStream output, {bool close: true}) {
     _pipe(this, output, close: close);
   }
 
diff --git a/runtime/bin/stream_util.dart b/runtime/bin/stream_util.dart
index 2a55cc4..fc6ee1f 100644
--- a/runtime/bin/stream_util.dart
+++ b/runtime/bin/stream_util.dart
@@ -31,7 +31,7 @@
     return _readInto(buffer, offset, bytesToRead);
   }
 
-  void pipe(OutputStream output, [bool close = true]) {
+  void pipe(OutputStream output, {bool close: true}) {
     _pipe(this, output, close: close);
   }
 
@@ -145,7 +145,7 @@
 }
 
 
-void _pipe(InputStream input, OutputStream output, [bool close]) {
+void _pipe(InputStream input, OutputStream output, {bool close}) {
   Function pipeDataHandler;
   Function pipeCloseHandler;
   Function pipeNoPendingWriteHandler;
@@ -188,7 +188,7 @@
       // Encode and write data.
       _StringEncoder encoder = _StringEncoders.encoder(encoding);
       List<int> data = encoder.encodeString(string);
-      return write(data, copyBuffer: false);
+      return write(data, false);
     }
     return true;
   }
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 75a674f..3a2ca48 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -59,9 +59,9 @@
     return list;
   }
 
-  /**
-   * Collection interface.
-   */
+  // Collection interface.
+
+  bool contains(E element) => Collections.contains(this, element);
 
   void forEach(f(E element)) {
     Collections.forEach(this, f);
@@ -92,7 +92,7 @@
     return this.length === 0;
   }
 
-  void sort(int compare(E a, E b)) {
+  void sort([Comparator<E> compare = Comparable.compare]) {
     DualPivotQuicksort.sort(this, compare);
   }
 
@@ -201,9 +201,9 @@
     return list;
   }
 
-  /**
-   * Collection interface.
-   */
+  // Collection interface.
+
+  bool contains(E element) => Collections.contains(this, element);
 
   void forEach(f(E element)) {
     Collections.forEach(this, f);
@@ -234,7 +234,7 @@
     return this.length === 0;
   }
 
-  void sort(int compare(E a, E b)) {
+  void sort([Comparator<E> compare]) {
     throw const UnsupportedOperationException(
         "Cannot modify an immutable array");
   }
diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart
index feadf0e..708e291 100644
--- a/runtime/lib/byte_array.dart
+++ b/runtime/lib/byte_array.dart
@@ -123,6 +123,8 @@
 
   // Methods implementing the Collection interface.
 
+  bool contains(element) => Collections.contains(this, element);
+
   void forEach(void f(element)) {
     var len = this.length;
     for (var i = 0; i < len; i++) {
@@ -181,7 +183,7 @@
         "Cannot add to a non-extendable array");
   }
 
-  void sort(int compare(a, b)) {
+  void sort([Comparator compare = Comparable.compare]) {
     DualPivotQuicksort.sort(this, compare);
   }
 
@@ -1659,7 +1661,7 @@
         "Cannot add to a non-extendable array");
   }
 
-  void sort(int compare(a, b)) {
+  void sort([Comparator compare = Comparable.compare]) {
     DualPivotQuicksort.sort(this, compare);
   }
 
diff --git a/runtime/lib/date_patch.dart b/runtime/lib/date_patch.dart
index f9740b4..aee640f 100644
--- a/runtime/lib/date_patch.dart
+++ b/runtime/lib/date_patch.dart
@@ -6,13 +6,13 @@
 // VM implementation of DateImplementation.
 patch class DateImplementation {
   /* patch */ DateImplementation(int year,
-                                 [int month = 1,
-                                  int day = 1,
-                                  int hour = 0,
-                                  int minute = 0,
-                                  int second = 0,
-                                  int millisecond = 0,
-                                  bool isUtc = false])
+                                 int month,
+                                 int day,
+                                 int hour,
+                                 int minute,
+                                 int second,
+                                 int millisecond,
+                                 bool isUtc)
       : this.isUtc = isUtc,
         this.millisecondsSinceEpoch = _brokenDownDateToMillisecondsSinceEpoch(
             year, month, day, hour, minute, second, millisecond, isUtc) {
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index 58ec00c..ad4765b 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -166,9 +166,9 @@
     _setData(new_data);
   }
 
-  /**
-   * Collection interface.
-   */
+  // Collection interface.
+
+  bool contains(T element) => Collections.contains(this, element);
 
   void forEach(f(T element)) {
     // TODO(srdjan): Use Collections.forEach(this, f);
@@ -207,7 +207,7 @@
     this.length = 0;
   }
 
-  void sort(int compare(T a, T b)) {
+  void sort([Comparator<T> compare = Comparable.compare]) {
     DualPivotQuicksort.sort(this, compare);
   }
 
@@ -216,28 +216,6 @@
   }
 
   Iterator<T> iterator() {
-    return new VariableSizeArrayIterator<T>(this);
+    return new SequenceIterator<T>(this);
   }
 }
-
-
-// Iterator for arrays with variable size.
-class VariableSizeArrayIterator<T> implements Iterator<T> {
-  VariableSizeArrayIterator(_GrowableObjectArray<T> array)
-      : _array = array,  _pos = 0 {
-  }
-
-  bool hasNext() {
-    return _array.length > _pos;
-  }
-
-  T next() {
-    if (!hasNext()) {
-      throw const NoMoreElementsException();
-    }
-    return _array[_pos++];
-  }
-
-  final _GrowableObjectArray<T> _array;
-  int _pos;
-}
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index e0d3608..f2b46b7 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -213,7 +213,7 @@
     }
   }
   int _shlFromInt(int other) {
-    throw const OutOfMemoryException();
+    throw const OutOfMemoryError();
   }
 }
 
@@ -238,7 +238,7 @@
     }
   }
   int _shlFromInt(int other) {
-    throw const OutOfMemoryException();
+    throw const OutOfMemoryError();
   }
 
   int pow(int exponent) {
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 3c59c5c..d2fec8b 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -168,7 +168,7 @@
                             const String& uri,
                             char** canonical_uri,
                             char** error) {
-  StackZone* zone = isolate->current_zone();
+  Zone* zone = isolate->current_zone();
   Dart_LibraryTagHandler handler = isolate->library_tag_handler();
   if (handler == NULL) {
     *error = zone->PrintToString(
diff --git a/runtime/lib/regexp_jsc.cc b/runtime/lib/regexp_jsc.cc
index ef36edd..31cee70 100644
--- a/runtime/lib/regexp_jsc.cc
+++ b/runtime/lib/regexp_jsc.cc
@@ -16,7 +16,7 @@
 namespace dart {
 
 static uint16_t* GetTwoByteData(const String& str) {
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   uint16_t* two_byte_str = zone->Alloc<uint16_t>(str.Length());
   for (intptr_t i = 0; i < str.Length(); i++) {
     two_byte_str[i] = str.CharAt(i);
@@ -117,7 +117,7 @@
   ASSERT(jscregexp != NULL);
   const Smi& num_bracket_exprs = Smi::Handle(regex.num_bracket_expressions());
   intptr_t num_bracket_expressions = num_bracket_exprs.Value();
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   // The jscre library rounds the passed in size to a multiple of 3 in order
   // to reuse the passed in offsets array as a temporary chunk of working
   // storage during matching, so we just pass in a size which is a multiple
diff --git a/runtime/lib/string.cc b/runtime/lib/string.cc
index 6b78f89..41c3181 100644
--- a/runtime/lib/string.cc
+++ b/runtime/lib/string.cc
@@ -14,7 +14,7 @@
 DEFINE_NATIVE_ENTRY(StringBase_createFromCodePoints, 1) {
   GET_NATIVE_ARGUMENT(Array, a, arguments->At(0));
   // TODO(srdjan): Check that parameterized type is an int.
-  StackZone* zone = isolate->current_zone();
+  Zone* zone = isolate->current_zone();
   intptr_t len = a.Length();
 
   // Unbox the array and determine the maximum element width.
diff --git a/runtime/platform/thread_android.cc b/runtime/platform/thread_android.cc
index 51e6561..da00de1 100644
--- a/runtime/platform/thread_android.cc
+++ b/runtime/platform/thread_android.cc
@@ -130,7 +130,7 @@
 
 
 intptr_t Thread::GetMaxStackSize() {
-  const int kStackSize = (512 * KB);
+  const int kStackSize = (128 * kWordSize * KB);
   return kStackSize;
 }
 
diff --git a/runtime/platform/thread_linux.cc b/runtime/platform/thread_linux.cc
index 30e8dcd..8ac046a 100644
--- a/runtime/platform/thread_linux.cc
+++ b/runtime/platform/thread_linux.cc
@@ -130,7 +130,7 @@
 
 
 intptr_t Thread::GetMaxStackSize() {
-  const int kStackSize = (512 * KB);
+  const int kStackSize = (128 * kWordSize * KB);
   return kStackSize;
 }
 
diff --git a/runtime/platform/thread_macos.cc b/runtime/platform/thread_macos.cc
index 3c6c91a..a8401b3 100644
--- a/runtime/platform/thread_macos.cc
+++ b/runtime/platform/thread_macos.cc
@@ -114,7 +114,7 @@
 
 
 intptr_t Thread::GetMaxStackSize() {
-  const int kStackSize = (512 * KB);
+  const int kStackSize = (128 * kWordSize * KB);
   return kStackSize;
 }
 
diff --git a/runtime/platform/thread_win.cc b/runtime/platform/thread_win.cc
index 4a93279..6fffe93 100644
--- a/runtime/platform/thread_win.cc
+++ b/runtime/platform/thread_win.cc
@@ -84,7 +84,7 @@
 
 
 intptr_t Thread::GetMaxStackSize() {
-  const int kStackSize = (512 * KB);
+  const int kStackSize = (128 * kWordSize * KB);
   return kStackSize;
 }
 
diff --git a/runtime/tests/vm/dart/isolate_mirror_local_test.dart b/runtime/tests/vm/dart/isolate_mirror_local_test.dart
index 2771bb2..d9c0c9a 100644
--- a/runtime/tests/vm/dart/isolate_mirror_local_test.dart
+++ b/runtime/tests/vm/dart/isolate_mirror_local_test.dart
@@ -311,17 +311,17 @@
   Expect.equals("ClassMirror on 'List'", list_intf.toString());
 
   // Lookup a class from a library and make sure it is sane.
-  ClassMirror oom_cls = core_lib.members['OutOfMemoryException'];
+  ClassMirror oom_cls = core_lib.members['OutOfMemoryError'];
   Expect.isTrue(oom_cls is ClassMirror);
-  Expect.equals('OutOfMemoryException', oom_cls.simpleName);
-  Expect.equals('dart:core.OutOfMemoryException', oom_cls.qualifiedName);
+  Expect.equals('OutOfMemoryError', oom_cls.simpleName);
+  Expect.equals('dart:core.OutOfMemoryError', oom_cls.qualifiedName);
   Expect.isFalse(oom_cls.isPrivate);
   Expect.equals('Object', oom_cls.superclass.simpleName);
   Expect.isTrue(oom_cls.defaultFactory === null);
   Expect.equals('dart:core', oom_cls.owner.simpleName);
   Expect.isTrue(oom_cls.isClass);
   Expect.equals('Exception', oom_cls.superinterfaces[0].simpleName);
-  Expect.equals("ClassMirror on 'OutOfMemoryException'",
+  Expect.equals("ClassMirror on 'OutOfMemoryError'",
                 oom_cls.toString());
   testDone('testLibrariesMap');
 }
diff --git a/runtime/tools/make_version.py b/runtime/tools/make_version.py
index 73cfbe1..f348a1e 100644
--- a/runtime/tools/make_version.py
+++ b/runtime/tools/make_version.py
@@ -14,23 +14,31 @@
 from optparse import OptionParser
 
 def getVersionPart(version_file, part):
-  proc = subprocess.Popen(['awk',
-                           '$1 == "%s" {print $2}' % (part),
-                           version_file],
+  command = ['awk', '$1 == "%s" {print $2}' % (part), version_file]
+  print "Getting version part: %s Running command %s" % (part, command)
+  proc = subprocess.Popen(command,
                           stdout=subprocess.PIPE,
                           stderr=subprocess.STDOUT)
-  return proc.communicate()[0].split('\n')[0]
+  result = proc.communicate()[0].split('\n')[0]
+  print "Got result: %s" % result
+  return result
 
 def getRevision():
+  print "Getting revision"
   is_svn = True
   if os.path.exists('.svn'):
+    print "Using svn to get revision"
     cmd = ['svn', 'info']
   else:
+    print "Using git svn to get revision"
     cmd = ['git', 'svn', 'info']
   try:
+    print "Running command to get revision: %s" % cmd
     proc = subprocess.Popen(cmd,
                             stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-    return proc.communicate()[0].split('\n')[4].split(' ')[1]
+    revision = proc.communicate()[0].split('\n')[4].split(' ')[1]
+    print "Got revision: %s" % revision
+    return revision
   except Exception:
     # If we can't get any revision info (due to lack of tooling) return ''.
     return ''
@@ -46,14 +54,26 @@
   patch = getVersionPart(version_file, 'PATCH')
   revision = getRevision()
   user = getpass.getuser()
-  return '%s.%s.%s.%s_%s_%s' % (major, minor, build, patch, revision, user)
+  version_string = '%s.%s.%s.%s_%s_%s' % (major,
+                                          minor,
+                                          build,
+                                          patch,
+                                          revision,
+                                          user)
+  print "Returning version string: %s " % version_string
+  return version_string
 
 def makeFile(output_file, input_file, version_file):
+  print "Making version file"
   version_cc_text = open(input_file).read()
+  version_string = makeVersionString(version_file)
+  print "Writing version to version_cc file: %s" % version_string
   version_cc_text = version_cc_text.replace("{{VERSION_STR}}",
-                                            makeVersionString(version_file))
+                                            version_string)
+  version_time = time.ctime(time.time())
+  print "Writing time to version_cc file: %s" % version_time
   version_cc_text = version_cc_text.replace("{{BUILD_TIME}}",
-                                            time.ctime(time.time()))
+                                            version_time)
   open(output_file, 'w').write(version_cc_text)
   return True
 
diff --git a/runtime/vm/assembler.cc b/runtime/vm/assembler.cc
index 234597e..32b4812 100644
--- a/runtime/vm/assembler.cc
+++ b/runtime/vm/assembler.cc
@@ -14,7 +14,7 @@
 namespace dart {
 
 static uword NewContents(intptr_t capacity) {
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   uword result = zone->AllocUnsafe(capacity);
 #if defined(DEBUG)
   // Initialize the buffer with kBreakPointInstruction to force a break
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index b70119d..d63dd7f 100644
--- a/runtime/vm/ast.cc
+++ b/runtime/vm/ast.cc
@@ -82,7 +82,7 @@
 
 // TODO(srdjan): Add code for logical negation.
 AstNode* LiteralNode::ApplyUnaryOp(Token::Kind unary_op_kind) {
-  if (unary_op_kind == Token::kSUB) {
+  if (unary_op_kind == Token::kNEGATE) {
     if (literal().IsSmi()) {
       const Smi& smi = Smi::Cast(literal());
       const Instance& literal =
@@ -255,7 +255,7 @@
 bool UnaryOpNode::IsKindValid() const {
   switch (kind_) {
     case Token::kADD:
-    case Token::kSUB:
+    case Token::kNEGATE:
     case Token::kNOT:
     case Token::kBIT_NOT:
       return true;
@@ -272,7 +272,7 @@
   }
   switch (kind_) {
     case Token::kADD:
-    case Token::kSUB:
+    case Token::kNEGATE:
       return val->IsNumber() ? val : NULL;
     case Token::kNOT:
       return val->IsBool() ? val : NULL;
diff --git a/runtime/vm/ast_printer_test.cc b/runtime/vm/ast_printer_test.cc
index deb5961..c5d24e4 100644
--- a/runtime/vm/ast_printer_test.cc
+++ b/runtime/vm/ast_printer_test.cc
@@ -33,7 +33,7 @@
                           Token::kADD,
                           new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(3))),
                           new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(5)))));
-  AstPrinter::PrintNode(new UnaryOpNode(kPos, Token::kSUB, ll));
+  AstPrinter::PrintNode(new UnaryOpNode(kPos, Token::kNEGATE, ll));
 }
 
 }  // namespace dart
diff --git a/runtime/vm/ast_test.cc b/runtime/vm/ast_test.cc
index 07b8b0f..8a377b2 100644
--- a/runtime/vm/ast_test.cc
+++ b/runtime/vm/ast_test.cc
@@ -46,8 +46,9 @@
   EXPECT_EQ(l, b->left());
   EXPECT_EQ(lln, b->right());
 
-  UnaryOpNode* u = new UnaryOpNode(Scanner::kDummyTokenIndex, Token::kSUB, b);
-  EXPECT_EQ(Token::kSUB, u->kind());
+  UnaryOpNode* u =
+      new UnaryOpNode(Scanner::kDummyTokenIndex, Token::kNEGATE, b);
+  EXPECT_EQ(Token::kNEGATE, u->kind());
   EXPECT_EQ(b, u->operand());
 
   SequenceNode* sequence_node = new SequenceNode(1, new LocalScope(NULL, 0, 0));
diff --git a/runtime/vm/base_isolate.h b/runtime/vm/base_isolate.h
index 090f1ce..f52c1b0 100644
--- a/runtime/vm/base_isolate.h
+++ b/runtime/vm/base_isolate.h
@@ -9,7 +9,7 @@
 
 class HandleScope;
 class StackResource;
-class StackZone;
+class Zone;
 
 // A BaseIsolate contains just enough functionality to allocate
 // StackResources.  This allows us to inline the StackResource
@@ -19,8 +19,8 @@
   StackResource* top_resource() const { return top_resource_; }
   void set_top_resource(StackResource* value) { top_resource_ = value; }
 
-  StackZone* current_zone() const { return current_zone_; }
-  void set_current_zone(StackZone* zone) { current_zone_ = zone; }
+  Zone* current_zone() const { return current_zone_; }
+  void set_current_zone(Zone* zone) { current_zone_ = zone; }
 
   HandleScope* top_handle_scope() const {
 #if defined(DEBUG)
@@ -102,7 +102,7 @@
   }
 
   StackResource* top_resource_;
-  StackZone* current_zone_;
+  Zone* current_zone_;
 #if defined(DEBUG)
   HandleScope* top_handle_scope_;
   int32_t no_handle_scope_depth_;
diff --git a/runtime/vm/bigint_operations.cc b/runtime/vm/bigint_operations.cc
index d4c7743..5690d7b 100644
--- a/runtime/vm/bigint_operations.cc
+++ b/runtime/vm/bigint_operations.cc
@@ -776,9 +776,17 @@
 
 RawBigint* BigintOperations::Modulo(const Bigint& a, const Bigint& b) {
   Bigint& quotient = Bigint::Handle();
-  Bigint& modulo = Bigint::Handle();
-  DivideRemainder(a, b, &quotient, &modulo);
-  return modulo.raw();
+  Bigint& remainder = Bigint::Handle();
+  DivideRemainder(a, b, &quotient, &remainder);
+  // Emulating code in Integer::ArithmeticOp (Euclidian modulo).
+  if (remainder.IsNegative()) {
+    if (b.IsNegative()) {
+      return BigintOperations::Subtract(remainder, b);
+    } else {
+      return BigintOperations::Add(remainder, b);
+    }
+  }
+  return remainder.raw();
 }
 
 
diff --git a/runtime/vm/bigint_operations_test.cc b/runtime/vm/bigint_operations_test.cc
index 94ef1a3..0c141a1 100644
--- a/runtime/vm/bigint_operations_test.cc
+++ b/runtime/vm/bigint_operations_test.cc
@@ -11,7 +11,7 @@
 namespace dart {
 
 static uword ZoneAllocator(intptr_t size) {
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   return zone->AllocUnsafe(size);
 }
 
diff --git a/runtime/vm/code_descriptors_test.cc b/runtime/vm/code_descriptors_test.cc
index 7b066b9..c92d032 100644
--- a/runtime/vm/code_descriptors_test.cc
+++ b/runtime/vm/code_descriptors_test.cc
@@ -192,6 +192,7 @@
   EXPECT_VALID(Dart_IntegerToInt64(k, &value));
   EXPECT_EQ(20, value);
   Isolate::Current()->heap()->CollectAllGarbage();
+  Dart_ExitScope();
 }
 
 
diff --git a/runtime/vm/code_generator.h b/runtime/vm/code_generator.h
index 81cfa8d..97b4672 100644
--- a/runtime/vm/code_generator.h
+++ b/runtime/vm/code_generator.h
@@ -59,6 +59,7 @@
   V(PolymorphicInstanceCallSmiOnly)                                            \
   V(PolymorphicInstanceCallSmiFail)                                            \
   V(PolymorphicInstanceCallTestFail)                                           \
+  V(InstanceCallNoICData)                                                      \
   V(IntegerToDouble)                                                           \
   V(DoubleToDouble)                                                            \
   V(BinarySmiOp)                                                               \
diff --git a/runtime/vm/code_generator_test.cc b/runtime/vm/code_generator_test.cc
index 5eb002a..1ac2d95 100644
--- a/runtime/vm/code_generator_test.cc
+++ b/runtime/vm/code_generator_test.cc
@@ -248,7 +248,7 @@
 CODEGEN_TEST_GENERATE(SmiUnaryOpCodegen, test) {
   SequenceNode* node_seq = test->node_sequence();
   LiteralNode* a = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(12)));
-  UnaryOpNode* neg_node = new UnaryOpNode(kPos, Token::kSUB, a);
+  UnaryOpNode* neg_node = new UnaryOpNode(kPos, Token::kNEGATE, a);
   node_seq->Add(new ReturnNode(kPos, neg_node));
 }
 CODEGEN_TEST_RUN(SmiUnaryOpCodegen, Smi::New(-12))
@@ -258,7 +258,7 @@
   SequenceNode* node_seq = test->node_sequence();
   LiteralNode* a =
       new LiteralNode(kPos, Double::ZoneHandle(Double::New(12.0, Heap::kOld)));
-  UnaryOpNode* neg_node = new UnaryOpNode(kPos, Token::kSUB, a);
+  UnaryOpNode* neg_node = new UnaryOpNode(kPos, Token::kNEGATE, a);
   node_seq->Add(new ReturnNode(kPos, neg_node));
 }
 CODEGEN_TEST_RUN(DoubleUnaryOpCodegen, Double::New(-12.0))
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 91bb459..8f0b6e3 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -194,7 +194,11 @@
         // Propagate sminess from CheckSmi to phis.
         optimizer.PropagateSminess();
 
+        // Use propagated class-ids to optimize further.
+        optimizer.ApplyClassIds();
+
         // Do optimizations that depend on the propagated type information.
+        // TODO(srdjan): Should this be called CanonicalizeComputations?
         optimizer.OptimizeComputations();
 
         // Unbox doubles.
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index ef99695..f8c18ed 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -200,7 +200,7 @@
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
 
-  char* buffer = zone.Alloc<char>(len + 1);
+  char* buffer = isolate->current_zone()->Alloc<char>(len + 1);
   va_list args2;
   va_start(args2, format);
   OS::VSNPrint(buffer, (len + 1), format, args2);
@@ -410,7 +410,7 @@
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
 
-  char* buffer = zone.Alloc<char>(len + 1);
+  char* buffer = isolate->current_zone()->Alloc<char>(len + 1);
   va_list args2;
   va_start(args2, format);
   OS::VSNPrint(buffer, (len + 1), format, args2);
@@ -432,7 +432,7 @@
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
 
-  char* buffer = zone.Alloc<char>(len + 1);
+  char* buffer = isolate->current_zone()->Alloc<char>(len + 1);
   va_list args2;
   va_start(args2, format);
   OS::VSNPrint(buffer, (len + 1), format, args2);
@@ -457,13 +457,14 @@
 
 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle) {
   Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
-  if (!obj.IsError()) {
-    return Api::NewError(
-        "%s expects argument 'handle' to be an error handle.  "
-        "Did you forget to check Dart_IsError first?",
-        CURRENT_FUNC);
+  {
+    const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+    if (!obj.IsError()) {
+      return Api::NewError(
+          "%s expects argument 'handle' to be an error handle.  "
+          "Did you forget to check Dart_IsError first?",
+          CURRENT_FUNC);
+    }
   }
   if (isolate->top_exit_frame_info() == 0) {
     // There are no dart frames on the stack so it would be illegal to
@@ -474,10 +475,19 @@
   // Unwind all the API scopes till the exit frame before propagating.
   ApiState* state = isolate->api_state();
   ASSERT(state != NULL);
-  state->UnwindScopes(isolate->top_exit_frame_info());
-  Exceptions::PropagateError(Error::Cast(obj));
+  const Error* error;
+  {
+    // We need to preserve the error object across the destruction of zones
+    // when the ApiScopes are unwound.  By using NoGCScope, we can ensure
+    // that GC won't touch the raw error object before creating a valid
+    // handle for it in the surviving zone.
+    NoGCScope no_gc;
+    RawError* raw_error = Api::UnwrapErrorHandle(isolate, handle).raw();
+    state->UnwindScopes(isolate->top_exit_frame_info());
+    error = &Error::Handle(isolate, raw_error);
+  }
+  Exceptions::PropagateError(*error);
   UNREACHABLE();
-
   return Api::NewError("Cannot reach here.  Internal error.");
 }
 
@@ -796,6 +806,7 @@
   Isolate* isolate = Dart::CreateIsolate(isolate_name);
   free(isolate_name);
   {
+    StackZone zone(isolate);
     DARTSCOPE_NOCHECKS(isolate);
     const Error& error_obj =
         Error::Handle(isolate,
@@ -1142,7 +1153,7 @@
 
 
 DART_EXPORT uint8_t* Dart_ScopeAllocate(intptr_t size) {
-  ApiZone* zone;
+  Zone* zone;
   Isolate* isolate = Isolate::Current();
   if (isolate != NULL) {
     ApiState* state = isolate->api_state();
@@ -3897,10 +3908,12 @@
 
 DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception) {
   Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Instance& excp = Api::UnwrapInstanceHandle(isolate, exception);
-  if (excp.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, exception, Instance);
+  CHECK_ISOLATE(isolate);
+  {
+    const Instance& excp = Api::UnwrapInstanceHandle(isolate, exception);
+    if (excp.IsNull()) {
+      RETURN_TYPE_ERROR(isolate, exception, Instance);
+    }
   }
   if (isolate->top_exit_frame_info() == 0) {
     // There are no dart frames on the stack so it would be illegal to
@@ -3911,8 +3924,15 @@
   // exception.
   ApiState* state = isolate->api_state();
   ASSERT(state != NULL);
-  state->UnwindScopes(isolate->top_exit_frame_info());
-  Exceptions::Throw(excp);
+  const Instance* saved_exception;
+  {
+    NoGCScope no_gc;
+    RawInstance* raw_exception =
+        Api::UnwrapInstanceHandle(isolate, exception).raw();
+    state->UnwindScopes(isolate->top_exit_frame_info());
+    saved_exception = &Instance::Handle(raw_exception);
+  }
+  Exceptions::Throw(*saved_exception);
   return Api::NewError("Exception was not thrown, internal error");
 }
 
@@ -3921,14 +3941,15 @@
                                               Dart_Handle stacktrace) {
   Isolate* isolate = Isolate::Current();
   CHECK_ISOLATE(isolate);
-  DARTSCOPE(isolate);
-  const Instance& excp = Api::UnwrapInstanceHandle(isolate, exception);
-  if (excp.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, exception, Instance);
-  }
-  const Instance& stk = Api::UnwrapInstanceHandle(isolate, stacktrace);
-  if (stk.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, stacktrace, Instance);
+  {
+    const Instance& excp = Api::UnwrapInstanceHandle(isolate, exception);
+    if (excp.IsNull()) {
+      RETURN_TYPE_ERROR(isolate, exception, Instance);
+    }
+    const Instance& stk = Api::UnwrapInstanceHandle(isolate, stacktrace);
+    if (stk.IsNull()) {
+      RETURN_TYPE_ERROR(isolate, stacktrace, Instance);
+    }
   }
   if (isolate->top_exit_frame_info() == 0) {
     // There are no dart frames on the stack so it would be illegal to
@@ -3939,8 +3960,19 @@
   // exception.
   ApiState* state = isolate->api_state();
   ASSERT(state != NULL);
-  state->UnwindScopes(isolate->top_exit_frame_info());
-  Exceptions::ReThrow(excp, stk);
+  const Instance* saved_exception;
+  const Instance* saved_stacktrace;
+  {
+    NoGCScope no_gc;
+    RawInstance* raw_exception =
+        Api::UnwrapInstanceHandle(isolate, exception).raw();
+    RawInstance* raw_stacktrace =
+        Api::UnwrapInstanceHandle(isolate, stacktrace).raw();
+    state->UnwindScopes(isolate->top_exit_frame_info());
+    saved_exception = &Instance::Handle(raw_exception);
+    saved_stacktrace = &Instance::Handle(raw_stacktrace);
+  }
+  Exceptions::ReThrow(*saved_exception, *saved_stacktrace);
   return Api::NewError("Exception was not re thrown, internal error");
 }
 
@@ -4423,7 +4455,7 @@
     pprof_symbol_generator->WriteToMemory(debug_region);
     *buffer_size = debug_region->size();
     if (*buffer_size != 0) {
-      ApiZone* zone = Api::TopScope(isolate)->zone();
+      Zone* zone = Api::TopScope(isolate)->zone();
       *buffer = reinterpret_cast<void*>(zone->AllocUnsafe(*buffer_size));
       memmove(*buffer, debug_region->data(), *buffer_size);
     } else {
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index 8341601..28c24dc 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -55,13 +55,11 @@
 #define DARTSCOPE_NOCHECKS(isolate)                                            \
   Isolate* __temp_isolate__ = (isolate);                                       \
   ASSERT(__temp_isolate__ != NULL);                                            \
-  StackZone zone(__temp_isolate__);                                            \
   HANDLESCOPE(__temp_isolate__);
 
 #define DARTSCOPE(isolate)                                                     \
   Isolate* __temp_isolate__ = (isolate);                                       \
   CHECK_ISOLATE_SCOPE(__temp_isolate__);                                       \
-  StackZone zone(__temp_isolate__);                                            \
   HANDLESCOPE(__temp_isolate__);
 
 
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 6997b753..870f998 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -1242,6 +1242,7 @@
   }
   Dart_ExitScope();
   {
+    StackZone zone(isolate);
     DARTSCOPE_NOCHECKS(isolate);
     for (int i = 0; i < 500; i++) {
       String& str = String::Handle();
@@ -1279,6 +1280,7 @@
   EXPECT(isolate != NULL);
   ApiState* state = isolate->api_state();
   EXPECT(state != NULL);
+  DARTSCOPE(isolate);
 
   // Start with a known persistent handle.
   Dart_Handle obj1 = Dart_True();
@@ -2192,6 +2194,7 @@
   ApiLocalScope* scope = state->top_scope();
   Dart_Handle handles[300];
   {
+    StackZone zone(isolate);
     DARTSCOPE_NOCHECKS(isolate);
     Smi& val = Smi::Handle();
 
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h
index c851b31..55b5ad0 100644
--- a/runtime/vm/dart_api_state.h
+++ b/runtime/vm/dart_api_state.h
@@ -28,10 +28,22 @@
 class ApiZone {
  public:
   // Create an empty zone.
-  ApiZone() : zone_() { }
+  ApiZone() : zone_() {
+    Isolate* isolate = Isolate::Current();
+    Zone* current_zone = isolate != NULL ? isolate->current_zone() : NULL;
+    zone_.Link(current_zone);
+    if (isolate != NULL) {
+      isolate->set_current_zone(&zone_);
+    }
+  }
 
   // Delete all memory associated with the zone.
-  ~ApiZone() { }
+  ~ApiZone() {
+    Isolate* isolate = Isolate::Current();
+    if (isolate != NULL && isolate->current_zone() == &zone_) {
+      isolate->set_current_zone(zone_.previous_);
+    }
+  }
 
   // Allocates an array sized to hold 'len' elements of type
   // 'ElementType'.  Checks for integer overflow when performing the
@@ -61,9 +73,9 @@
   // due to internal fragmentation in the segments.
   intptr_t SizeInBytes() const { return zone_.SizeInBytes(); }
 
- private:
-  Zone* GetBaseZone() { return &zone_; }
+  Zone* GetZone() { return &zone_; }
 
+ private:
   Zone zone_;
 
   template<typename T> friend class ApiGrowableArray;
@@ -446,7 +458,7 @@
   uword stack_marker() const { return stack_marker_; }
   void set_previous(ApiLocalScope* value) { previous_ = value; }
   LocalHandles* local_handles() { return &local_handles_; }
-  ApiZone* zone() { return &zone_; }
+  Zone* zone() { return zone_.GetZone(); }
 
  private:
   ApiLocalScope* previous_;
@@ -653,7 +665,7 @@
         Thread::GetThreadLocal(Api::api_native_key_));
   }
 
-  ApiZone* zone() { return &zone_; }
+  Zone* zone() { return zone_.GetZone(); }
 
  private:
   ApiZone zone_;
@@ -671,10 +683,10 @@
   explicit ApiGrowableArray(int initial_capacity)
       : BaseGrowableArray<T, ValueObject>(
           initial_capacity,
-          ApiNativeScope::Current()->zone()->GetBaseZone()) {}
+          ApiNativeScope::Current()->zone()) {}
   ApiGrowableArray()
       : BaseGrowableArray<T, ValueObject>(
-          ApiNativeScope::Current()->zone()->GetBaseZone()) {}
+          ApiNativeScope::Current()->zone()) {}
 };
 
 
diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc
index 22fcf4b..3a3a366 100644
--- a/runtime/vm/debugger_api_impl_test.cc
+++ b/runtime/vm/debugger_api_impl_test.cc
@@ -397,7 +397,7 @@
       "f2() { return 2; }       \n"
       "                         \n"
       "class X {                \n"
-      "  kvmk(a, [b, c]) {      \n"
+      "  kvmk(a, {b, c}) {      \n"
       "    return c + f2();     \n"
       "  }                      \n"
       "}                        \n"
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index 69b9e43..bb15671 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -417,6 +417,7 @@
     function ^= deopt_context->ObjectAt(object_table_index_);
     const Code& code =
         Code::Handle(deopt_context->isolate(), function.unoptimized_code());
+    ASSERT(!code.IsNull());
     intptr_t pc_marker = code.EntryPoint() +
                          AssemblerMacros::kOffsetOfSavedPCfromEntrypoint;
     intptr_t* to_addr = deopt_context->GetToFrameAddressAt(to_index);
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 0a14df1..ba723df 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -426,7 +426,7 @@
       break;
     case kOutOfMemory:
       library = Library::CoreLibrary();
-      class_name = Symbols::New("OutOfMemoryException");
+      class_name = Symbols::New("OutOfMemoryError");
       break;
     case kWrongArgumentCount:
       library = Library::CoreLibrary();
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 92250f2..12e685e 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -982,20 +982,14 @@
   ZoneGrowableArray<PushArgumentInstr*>* arguments =
       new ZoneGrowableArray<PushArgumentInstr*>(1);
   arguments->Add(push_value);
-  InstanceCallInstr* call = (node->kind() == Token::kSUB)
-      ? new InstanceCallInstr(node->token_pos(),
-                              String::ZoneHandle(Symbols::New("unary-")),
-                              Token::kNEGATE,
-                              arguments,
-                              Array::ZoneHandle(),
-                              1)
-      : new InstanceCallInstr(node->token_pos(),
-                              String::ZoneHandle(
-                                  Symbols::New(Token::Str(node->kind()))),
-                              node->kind(),
-                              arguments,
-                              Array::ZoneHandle(),
-                              1);
+  InstanceCallInstr* call =
+      new InstanceCallInstr(node->token_pos(),
+                            String::ZoneHandle(
+                                Symbols::New(Token::Str(node->kind()))),
+                            node->kind(),
+                            arguments,
+                            Array::ZoneHandle(),
+                            1);
   ReturnDefinition(call);
 }
 
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index ad81e2f..87fee91 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -896,4 +896,27 @@
 }
 
 
+FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid,
+                                                          Register array,
+                                                          intptr_t offset) {
+  switch (cid) {
+    case kArrayCid:
+    case kGrowableObjectArrayCid:
+    case kImmutableArrayCid: {
+      const intptr_t disp = offset * kWordSize + sizeof(RawArray);
+      ASSERT(Utils::IsInt(31, disp));
+      return FieldAddress(array, disp);
+    }
+    case kFloat64ArrayCid: {
+      const intptr_t disp =
+          offset * kDoubleSize + Float64Array::data_offset();
+      ASSERT(Utils::IsInt(31, disp));
+      return FieldAddress(array, disp);
+    }
+    default:
+      UNIMPLEMENTED();
+      return FieldAddress(SPREG, 0);
+  }
+}
+
 }  // namespace dart
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 1dd972f..410f0d9 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -26,6 +26,24 @@
 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic.");
 
 
+FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid,
+                                                          Register array,
+                                                          Register index) {
+  // Note that index is Smi, i.e, times 2.
+  ASSERT(kSmiTagShift == 1);
+  switch (cid) {
+    case kArrayCid:
+    case kImmutableArrayCid:
+      return FieldAddress(array, index, TIMES_2, sizeof(RawArray));
+    case kFloat64ArrayCid:
+      return FieldAddress(array, index, TIMES_4, Float64Array::data_offset());
+    default:
+      UNIMPLEMENTED();
+      return FieldAddress(SPREG, 0);
+  }
+}
+
+
 bool FlowGraphCompiler::SupportsUnboxedMints() {
   // Support unboxed mints when SSE 4.1 is available.
   return FLAG_unbox_mints && CPUFeatures::sse4_1_supported();
diff --git a/runtime/vm/flow_graph_compiler_ia32.h b/runtime/vm/flow_graph_compiler_ia32.h
index b5d3043..cb215df 100644
--- a/runtime/vm/flow_graph_compiler_ia32.h
+++ b/runtime/vm/flow_graph_compiler_ia32.h
@@ -210,6 +210,14 @@
 
   static bool EvaluateCondition(Condition condition, intptr_t l, intptr_t r);
 
+  // Array/list element address computations.
+  static FieldAddress ElementAddressForIntIndex(intptr_t cid,
+                                                Register array,
+                                                intptr_t offset);
+  static FieldAddress ElementAddressForRegIndex(intptr_t cid,
+                                                Register array,
+                                                Register index);
+
  private:
   void GenerateDeferredCode();
 
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 849a405..6c76290 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -26,6 +26,24 @@
 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
 
 
+FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid,
+                                                          Register array,
+                                                          Register index) {
+  // Note that index is Smi, i.e, times 2.
+  ASSERT(kSmiTagShift == 1);
+  switch (cid) {
+    case kArrayCid:
+    case kImmutableArrayCid:
+      return FieldAddress(array, index, TIMES_4, sizeof(RawArray));
+    case kFloat64ArrayCid:
+      return FieldAddress(array, index, TIMES_4, Float64Array::data_offset());
+    default:
+      UNIMPLEMENTED();
+      return FieldAddress(SPREG, 0);
+  }
+}
+
+
 bool FlowGraphCompiler::SupportsUnboxedMints() {
   return false;
 }
diff --git a/runtime/vm/flow_graph_compiler_x64.h b/runtime/vm/flow_graph_compiler_x64.h
index d652a4e..d278732 100644
--- a/runtime/vm/flow_graph_compiler_x64.h
+++ b/runtime/vm/flow_graph_compiler_x64.h
@@ -210,6 +210,14 @@
 
   static bool EvaluateCondition(Condition condition, intptr_t l, intptr_t r);
 
+  // Array/list element address computations.
+  static FieldAddress ElementAddressForIntIndex(intptr_t cid,
+                                                Register array,
+                                                intptr_t offset);
+  static FieldAddress ElementAddressForRegIndex(intptr_t cid,
+                                                Register array,
+                                                Register index);
+
  private:
   void GenerateDeferredCode();
 
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 5850c8d..2bf97c7 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -13,6 +13,7 @@
 #include "vm/intermediate_language.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
+#include "vm/resolver.h"
 #include "vm/scopes.h"
 #include "vm/symbols.h"
 
@@ -28,11 +29,82 @@
 DEFINE_FLAG(bool, trace_constant_propagation, false,
             "Print constant propagation and useless code elimination.");
 
+
 void FlowGraphOptimizer::ApplyICData() {
   VisitBlocks();
 }
 
 
+// Attempts to convert an instance call (IC call) using propagated class-ids,
+// e.g., receiver class id.
+void FlowGraphOptimizer::ApplyClassIds() {
+  ASSERT(current_iterator_ == NULL);
+  for (intptr_t i = 0; i < block_order_.length(); ++i) {
+    BlockEntryInstr* entry = block_order_[i];
+    ForwardInstructionIterator it(entry);
+    current_iterator_ = &it;
+    for (; !it.Done(); it.Advance()) {
+      if (it.Current()->IsInstanceCall()) {
+        InstanceCallInstr* call = it.Current()->AsInstanceCall();
+        if (call->HasICData()) {
+          if (TryCreateICData(call)) {
+            VisitInstanceCall(call);
+          }
+        }
+      }
+    }
+    current_iterator_ = NULL;
+  }
+}
+
+
+// Attempt to build ICData for call using propagated class-ids.
+bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) {
+  ASSERT(call->HasICData());
+  if (call->ic_data()->NumberOfChecks() > 0) {
+    // This occurs when an instance call has too many checks.
+    // TODO(srdjan): Replace IC call with megamorphic call.
+    return false;
+  }
+  GrowableArray<intptr_t> class_ids(call->ic_data()->num_args_tested());
+  ASSERT(call->ic_data()->num_args_tested() <= call->ArgumentCount());
+  for (intptr_t i = 0; i < call->ic_data()->num_args_tested(); i++) {
+    intptr_t cid = call->ArgumentAt(i)->value()->ResultCid();
+    class_ids.Add(cid);
+  }
+  // TODO(srdjan): Test for other class_ids > 1.
+  if (class_ids.length() != 1) return false;
+  if (class_ids[0] != kDynamicCid) {
+    const intptr_t num_named_arguments = call->argument_names().IsNull() ?
+        0 : call->argument_names().Length();
+    const Class& receiver_class = Class::Handle(
+        Isolate::Current()->class_table()->At(class_ids[0]));
+    Function& function = Function::Handle();
+    function = Resolver::ResolveDynamicForReceiverClass(
+        receiver_class,
+        call->function_name(),
+        call->ArgumentCount(),
+        num_named_arguments);
+    if (function.IsNull()) {
+      return false;
+    }
+    // Create new ICData, do not modify the one attached to the instruction
+    // since it is attached to the assembly instruction itself.
+    // TODO(srdjan): Prevent modification of ICData object that is
+    // referenced in assembly code.
+    ICData& ic_data = ICData::ZoneHandle(ICData::New(
+        flow_graph_->parsed_function().function(),
+        call->function_name(),
+        call->deopt_id(),
+        class_ids.length()));
+    ic_data.AddReceiverCheck(class_ids[0], function);
+    call->set_ic_data(&ic_data);
+    return true;
+  }
+  return false;
+}
+
+
 static void ReplaceCurrentInstruction(ForwardInstructionIterator* it,
                                       Instruction* current,
                                       Instruction* replacement) {
@@ -374,76 +446,173 @@
 }
 
 
-bool FlowGraphOptimizer::TryReplaceWithArrayOp(InstanceCallInstr* call,
-                                               Token::Kind op_kind) {
-  // TODO(fschneider): Optimize []= operator in checked mode as well.
-  if (op_kind == Token::kASSIGN_INDEX && FLAG_enable_type_checks) return false;
+// Returns array classid to load from, array and idnex value
 
+intptr_t FlowGraphOptimizer::PrepareIndexedOp(InstanceCallInstr* call,
+                                              intptr_t class_id,
+                                              Value** array,
+                                              Value** index) {
+  *array = call->ArgumentAt(0)->value();
+  *index = call->ArgumentAt(1)->value();
+  // Insert class check and index smi checks and attach a copy of the
+  // original environment because the operation can still deoptimize.
+  AddCheckClass(call, (*array)->Copy());
+  InsertBefore(call,
+               new CheckSmiInstr((*index)->Copy(), call->deopt_id()),
+               call->env(),
+               Definition::kEffect);
+  // If both index and array are constants, then the bound check always
+  // succeeded.
+  // TODO(srdjan): Remove once constant propagation lands.
+  if (!((*array)->BindsToConstant() && (*index)->BindsToConstant())) {
+    // Insert array bounds check.
+    InsertBefore(call,
+                 new CheckArrayBoundInstr((*array)->Copy(),
+                                          (*index)->Copy(),
+                                          class_id,
+                                          call),
+                 call->env(),
+                 Definition::kEffect);
+  }
+  if (class_id == kGrowableObjectArrayCid) {
+    // Insert data elements load.
+    LoadFieldInstr* elements =
+        new LoadFieldInstr((*array)->Copy(),
+                           GrowableObjectArray::data_offset(),
+                           Type::ZoneHandle(Type::DynamicType()));
+    elements->set_result_cid(kArrayCid);
+    InsertBefore(call, elements, NULL, Definition::kValue);
+    *array = new Value(elements);
+    return kArrayCid;
+  }
+  return class_id;
+}
+
+
+bool FlowGraphOptimizer::TryReplaceWithStoreIndexed(InstanceCallInstr* call) {
+  const intptr_t class_id = ReceiverClassId(call);
+  ICData& value_check = ICData::Handle();
+  switch (class_id) {
+    case kArrayCid:
+    case kGrowableObjectArrayCid:
+      // Acceptable store index classes.
+      break;
+    case kFloat64ArrayCid: {
+      // Check that value is always double.
+      value_check = call->ic_data()->AsUnaryClassChecksForArgNr(2);
+      if ((value_check.NumberOfChecks() != 1) ||
+          (value_check.GetReceiverClassIdAt(0) != kDoubleCid)) {
+        return false;
+      }
+      break;
+    }
+    default:
+      // TODO(fschneider): Add support for other array types.
+      return false;
+  }
+
+  if (FLAG_enable_type_checks) {
+    Value* array = call->ArgumentAt(0)->value();
+    Value* value = call->ArgumentAt(2)->value();
+    // Only type check for the value. A type check for the index is not
+    // needed here because we insert a deoptimizing smi-check for the case
+    // the index is not a smi.
+    const Function& target =
+        Function::ZoneHandle(call->ic_data()->GetTargetAt(0));
+    const AbstractType& value_type =
+        AbstractType::ZoneHandle(target.ParameterTypeAt(2));
+    Value* instantiator = NULL;
+    Value* type_args = NULL;
+    switch (class_id) {
+      case kArrayCid:
+      case kGrowableObjectArrayCid: {
+        const Class& instantiator_class = Class::Handle(target.Owner());
+        intptr_t type_arguments_instance_field_offset =
+            instantiator_class.type_arguments_instance_field_offset();
+        LoadFieldInstr* load_type_args =
+            new LoadFieldInstr(array->Copy(),
+                               type_arguments_instance_field_offset,
+                               Type::ZoneHandle());  // No type.
+        InsertBefore(call, load_type_args, NULL, Definition::kValue);
+        instantiator = array->Copy();
+        type_args = new Value(load_type_args);
+        break;
+      }
+      case kFloat64ArrayCid: {
+        ConstantInstr* null_constant = new ConstantInstr(Object::ZoneHandle());
+        InsertBefore(call, null_constant, NULL, Definition::kValue);
+        instantiator = new Value(null_constant);
+        type_args = new Value(null_constant);
+        ASSERT(value_type.IsDoubleType());
+        ASSERT(value_type.IsInstantiated());
+        break;
+      }
+      default:
+        // TODO(fschneider): Add support for other array types.
+        UNREACHABLE();
+    }
+    AssertAssignableInstr* assert_value =
+        new AssertAssignableInstr(call->token_pos(),
+                                  value->Copy(),
+                                  instantiator,
+                                  type_args,
+                                  value_type,
+                                  String::ZoneHandle(Symbols::New("value")));
+    InsertBefore(call, assert_value, NULL, Definition::kValue);
+  }
+
+  Value* array = NULL;
+  Value* index = NULL;
+  intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index);
+  Value* value = call->ArgumentAt(2)->value();
+  // Check if store barrier is needed.
+  bool needs_store_barrier = true;
+  if (class_id == kFloat64ArrayCid) {
+    ASSERT(!value_check.IsNull());
+    InsertBefore(call,
+                 new CheckClassInstr(value->Copy(),
+                                     call->deopt_id(),
+                                     value_check),
+                 call->env(),
+                 Definition::kEffect);
+    needs_store_barrier = false;
+  } else if (ArgIsAlwaysSmi(*call->ic_data(), 2)) {
+    InsertBefore(call,
+                 new CheckSmiInstr(value->Copy(), call->deopt_id()),
+                 call->env(),
+                 Definition::kEffect);
+    needs_store_barrier = false;
+  }
+
+  Definition* array_op =
+      new StoreIndexedInstr(array, index, value,
+                            needs_store_barrier, array_cid, call->deopt_id());
+  call->ReplaceWith(array_op, current_iterator());
+  RemovePushArguments(call);
+  return true;
+}
+
+
+
+bool FlowGraphOptimizer::TryReplaceWithLoadIndexed(InstanceCallInstr* call) {
   const intptr_t class_id = ReceiverClassId(call);
   switch (class_id) {
-    case kImmutableArrayCid:
-      // Stores are only specialized for Array and GrowableObjectArray,
-      // not for ImmutableArray.
-      if (op_kind == Token::kASSIGN_INDEX) return false;
-      // Fall through.
     case kArrayCid:
-    case kGrowableObjectArrayCid: {
-      Value* array = call->ArgumentAt(0)->value();
-      Value* index = call->ArgumentAt(1)->value();
-      // Insert class check and index smi checks and attach a copy of the
-      // original environment because the operation can still deoptimize.
-      AddCheckClass(call, array->Copy());
-      InsertBefore(call,
-                   new CheckSmiInstr(index->Copy(), call->deopt_id()),
-                   call->env(),
-                   Definition::kEffect);
-      // If both index and array are constants, then the bound check always
-      // succeeded.
-      // TODO(srdjan): Remove once constant propagation lands.
-      if (!(array->BindsToConstant() && index->BindsToConstant())) {
-        // Insert array bounds check.
-        InsertBefore(call,
-                     new CheckArrayBoundInstr(array->Copy(),
-                                              index->Copy(),
-                                              class_id,
-                                              call),
-                     call->env(),
-                     Definition::kEffect);
-      }
-      if (class_id == kGrowableObjectArrayCid) {
-        // Insert data elements load.
-        LoadFieldInstr* elements =
-            new LoadFieldInstr(array->Copy(),
-                               GrowableObjectArray::data_offset(),
-                               Type::ZoneHandle(Type::DynamicType()));
-        elements->set_result_cid(kArrayCid);
-        InsertBefore(call, elements, NULL, Definition::kValue);
-        array = new Value(elements);
-      }
-      Definition* array_op = NULL;
-      if (op_kind == Token::kINDEX) {
-        array_op = new LoadIndexedInstr(array, index);
-      } else {
-        bool needs_store_barrier = true;
-        if (ArgIsAlwaysSmi(*call->ic_data(), 2)) {
-          InsertBefore(call,
-                       new CheckSmiInstr(call->ArgumentAt(2)->value()->Copy(),
-                                         call->deopt_id()),
-                       call->env(),
-                       Definition::kEffect);
-          needs_store_barrier = false;
-        }
-        Value* value = call->ArgumentAt(2)->value();
-        array_op =
-            new StoreIndexedInstr(array, index, value, needs_store_barrier);
-      }
-      call->ReplaceWith(array_op, current_iterator());
-      RemovePushArguments(call);
-      return true;
-    }
+    case kImmutableArrayCid:
+    case kGrowableObjectArrayCid:
+    case kFloat64ArrayCid:
+      // Acceptable load index classes.
+      break;
     default:
       return false;
   }
+  Value* array = NULL;
+  Value* index = NULL;
+  intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index);
+  Definition* array_op = new LoadIndexedInstr(array, index, array_cid);
+  call->ReplaceWith(array_op, current_iterator());
+  RemovePushArguments(call);
+  return true;
 }
 
 
@@ -606,6 +775,9 @@
           new BinarySmiOpInstr(Token::kBIT_AND, call, left, new Value(c));
       call->ReplaceWith(bin_op, current_iterator());
       RemovePushArguments(call);
+    } else {
+      // Did not replace.
+      return false;
     }
   } else {
     ASSERT(operands_type == kSmiCid);
@@ -960,15 +1132,18 @@
 void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
   if (instr->HasICData() && (instr->ic_data()->NumberOfChecks() > 0)) {
     const Token::Kind op_kind = instr->token_kind();
-    if (Token::IsIndexOperator(op_kind) &&
-        TryReplaceWithArrayOp(instr, op_kind)) {
+    if ((op_kind == Token::kASSIGN_INDEX) &&
+        TryReplaceWithStoreIndexed(instr)) {
       return;
     }
-    if (Token::IsBinaryToken(op_kind) &&
+    if ((op_kind == Token::kINDEX) && TryReplaceWithLoadIndexed(instr)) {
+      return;
+    }
+    if (Token::IsBinaryOperator(op_kind) &&
         TryReplaceWithBinaryOp(instr, op_kind)) {
       return;
     }
-    if (Token::IsUnaryToken(op_kind) &&
+    if (Token::IsPrefixOperator(op_kind) &&
         TryReplaceWithUnaryOp(instr, op_kind)) {
       return;
     }
@@ -1010,8 +1185,7 @@
       instr->ReplaceWith(call, current_iterator());
     }
   }
-  // An instance call without ICData should continue calling via IC calls
-  // which should trigger reoptimization of optimized code.
+  // An instance call without ICData will trigger deoptimization.
 }
 
 
@@ -2131,19 +2305,26 @@
   // i.e. the receiver argument or the constructor phase argument.
   AbstractType& param_type = AbstractType::Handle(Type::DynamicType());
   param->SetPropagatedCid(kDynamicCid);
-  if (param->index() < 2) {
+  bool param_type_is_known = false;
+  if (param->index() == 0) {
     const Function& function = parsed_function().function();
-    if (((param->index() == 0) && function.IsDynamicFunction()) ||
-        ((param->index() == 1) && function.IsConstructor())) {
-      // Parameter is the receiver or the constructor phase.
-      LocalScope* scope = parsed_function().node_sequence()->scope();
-      param_type = scope->VariableAt(param->index())->type().raw();
-      if (FLAG_use_cha) {
-        const intptr_t cid = Class::Handle(param_type.type_class()).id();
-        if (!CHA::HasSubclasses(cid)) {
-          // Receiver's class has no subclasses.
-          param->SetPropagatedCid(cid);
-        }
+    if ((function.IsDynamicFunction() || function.IsConstructor())) {
+      // Parameter is the receiver .
+      param_type_is_known = true;
+    }
+  } else if ((param->index() == 1) &&
+      parsed_function().function().IsConstructor()) {
+    // Parameter is the constructor phase.
+    param_type_is_known = true;
+  }
+  if (param_type_is_known) {
+    LocalScope* scope = parsed_function().node_sequence()->scope();
+    param_type = scope->VariableAt(param->index())->type().raw();
+    if (FLAG_use_cha) {
+      const intptr_t cid = Class::Handle(param_type.type_class()).id();
+      if (!CHA::HasSubclasses(cid)) {
+        // Receiver's class has no subclasses.
+        param->SetPropagatedCid(cid);
       }
     }
   }
@@ -2275,7 +2456,11 @@
               break;
             }
           }
-          if (inputs_loop_invariant) {
+          if (inputs_loop_invariant &&
+              !current->IsAssertAssignable() &&
+              !current->IsAssertBoolean()) {
+            // TODO(fschneider): Enable hoisting of Assert-instructions
+            // if it safe to do.
             Hoist(&it, pre_header, current);
           } else if (current->IsCheckSmi() &&
                      current->InputAt(0)->definition()->IsPhi()) {
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index 1d5afe2..041221d 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -20,8 +20,12 @@
         flow_graph_(flow_graph) { }
   virtual ~FlowGraphOptimizer() {}
 
+  // Use ICData to optimize, replace or eliminate instructions.
   void ApplyICData();
 
+  // Use propagated class ids to optimize, replace or eliminate instructions.
+  void ApplyClassIds();
+
   void OptimizeComputations();
 
   void EliminateDeadPhis();
@@ -44,7 +48,16 @@
                     Definition::UseKind use_kind);
 
  private:
-  bool TryReplaceWithArrayOp(InstanceCallInstr* call, Token::Kind op_kind);
+  // Attempt to build ICData for call using propagated class-ids.
+  bool TryCreateICData(InstanceCallInstr* call);
+
+  intptr_t PrepareIndexedOp(InstanceCallInstr* call,
+                            intptr_t class_id,
+                            Value** array,
+                            Value** index);
+  bool TryReplaceWithStoreIndexed(InstanceCallInstr* call);
+  bool TryReplaceWithLoadIndexed(InstanceCallInstr* call);
+
   bool TryReplaceWithBinaryOp(InstanceCallInstr* call, Token::Kind op_kind);
   bool TryReplaceWithUnaryOp(InstanceCallInstr* call, Token::Kind op_kind);
 
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index 86cad12..eee2b13 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -17,17 +17,23 @@
   intptr_t in_use = page->used();
   page->set_used(0);
 
-  uword current = page->first_object_start();
-  uword top = page->top();
+  // Whole page is empty. Do not enter anything into the freelist.
+  if (in_use == 0) {
+    return 0;
+  }
 
-  while (current < top) {
+  uword current = page->object_start();
+  uword end = page->object_end();
+
+  while (current < end) {
+    intptr_t obj_size;
     if (in_use_swept == in_use) {
       // No more marked objects will be found on this page.
-      page->set_top(current);
+      obj_size = end - current;
+      freelist->Free(current, obj_size);
       break;
     }
     RawObject* raw_obj = RawObject::FromAddr(current);
-    intptr_t obj_size;
     if (raw_obj->IsMarked()) {
       // Found marked object. Clear the mark bit and update swept bytes.
       raw_obj->ClearMarkBit();
@@ -35,7 +41,7 @@
       in_use_swept += obj_size;
     } else {
       uword free_end = current + raw_obj->Size();
-      while (free_end < top) {
+      while (free_end < end) {
         RawObject* next_obj = RawObject::FromAddr(free_end);
         if (next_obj->IsMarked()) {
           // Reached the end of the free block.
@@ -45,12 +51,7 @@
         free_end += next_obj->Size();
       }
       obj_size = free_end - current;
-      if ((current + obj_size) == top) {
-        page->set_top(current);
-        break;
-      } else {
-        freelist->Free(current, obj_size);
-      }
+      freelist->Free(current, obj_size);
     }
     current += obj_size;
   }
@@ -60,7 +61,7 @@
 
 
 intptr_t GCSweeper::SweepLargePage(HeapPage* page) {
-  RawObject* raw_obj = RawObject::FromAddr(page->first_object_start());
+  RawObject* raw_obj = RawObject::FromAddr(page->object_start());
   if (!raw_obj->IsMarked()) {
     // The large object was not marked. Used size is zero, which also tells the
     // calling code that the large object page can be recycled.
diff --git a/runtime/vm/gdbjit_android.cc b/runtime/vm/gdbjit_android.cc
index e38e880..101f378 100644
--- a/runtime/vm/gdbjit_android.cc
+++ b/runtime/vm/gdbjit_android.cc
@@ -31,12 +31,14 @@
     struct jit_code_entry* first_entry;
   };
 
+#ifndef GDB_JIT_SYMBOLS
   /* GDB puts a breakpoint in this function.  */
   void __attribute__((noinline)) __jit_debug_register_code() { }
 
   /* Make sure to specify the version statically, because the
      debugger may check the version before we can set it.  */
   struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
+#endif
 
   static struct jit_code_entry* first_dynamic_region = NULL;
   static struct jit_code_entry* last_dynamic_region = NULL;
diff --git a/runtime/vm/gdbjit_linux.cc b/runtime/vm/gdbjit_linux.cc
index 32f7cd7..35d4f44 100644
--- a/runtime/vm/gdbjit_linux.cc
+++ b/runtime/vm/gdbjit_linux.cc
@@ -31,12 +31,14 @@
     struct jit_code_entry* first_entry;
   };
 
+#ifndef GDB_JIT_SYMBOLS
   /* GDB puts a breakpoint in this function.  */
   void __attribute__((noinline)) __jit_debug_register_code() { }
 
   /* Make sure to specify the version statically, because the
      debugger may check the version before we can set it.  */
   struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
+#endif
 
   static struct jit_code_entry* first_dynamic_region = NULL;
   static struct jit_code_entry* last_dynamic_region = NULL;
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 66f508b..7a02b87 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -70,6 +70,15 @@
 #define ALIGN16 __attribute__((aligned(16)))
 #endif
 
+
+// Zap value used to indicate uninitialized handle area (debug purposes).
+#if defined(ARCH_IS_32_BIT)
+static const uword kZapUninitializedWord = 0xabababab;
+#else
+static const uword kZapUninitializedWord = 0xabababababababab;
+#endif
+
+
 }  // namespace dart
 
 #endif  // VM_GLOBALS_H_
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h
index 7379209..91c95c2 100644
--- a/runtime/vm/growable_array.h
+++ b/runtime/vm/growable_array.h
@@ -123,10 +123,10 @@
   explicit GrowableArray(int initial_capacity)
       : BaseGrowableArray<T, ValueObject>(
           initial_capacity,
-          Isolate::Current()->current_zone()->GetBaseZone()) {}
+          Isolate::Current()->current_zone()) {}
   GrowableArray()
       : BaseGrowableArray<T, ValueObject>(
-          Isolate::Current()->current_zone()->GetBaseZone()) {}
+          Isolate::Current()->current_zone()) {}
 };
 
 
@@ -136,10 +136,10 @@
   explicit ZoneGrowableArray(int initial_capacity)
       : BaseGrowableArray<T, ZoneAllocated>(
           initial_capacity,
-          Isolate::Current()->current_zone()->GetBaseZone()) {}
+          Isolate::Current()->current_zone()) {}
   ZoneGrowableArray() :
       BaseGrowableArray<T, ZoneAllocated>(
-          Isolate::Current()->current_zone()->GetBaseZone()) {}
+          Isolate::Current()->current_zone()) {}
 };
 
 }  // namespace dart
diff --git a/runtime/vm/handles.h b/runtime/vm/handles.h
index 92acd35..a512fd8 100644
--- a/runtime/vm/handles.h
+++ b/runtime/vm/handles.h
@@ -176,9 +176,6 @@
     void set_next_block(HandlesBlock* next) { next_block_ = next; }
 
    private:
-    // Zap value used to indicate uninitialized handle area (debug purposes).
-    static const uword kZapUninitializedWord = 0xabababab;
-
     uword data_[kHandleSizeInWords * kHandlesPerChunk];  // Handles area.
     intptr_t next_handle_slot_;  // Next slot for allocation in current block.
     HandlesBlock* next_block_;  // Link to next block of handles.
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 904cf2a..1dff5fb 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -86,6 +86,15 @@
 }
 
 
+bool AssertAssignableInstr::AttributesEqual(Instruction* other) const {
+  AssertAssignableInstr* other_assert = other->AsAssertAssignable();
+  ASSERT(other_assert != NULL);
+  // This predicate has to be commutative for DominatorBasedCSE to work.
+  // TODO(fschneider): Eliminate more asserts with subtype relation.
+  return dst_type().raw() == other_assert->dst_type().raw();
+}
+
+
 bool StrictCompareInstr::AttributesEqual(Instruction* other) const {
   StrictCompareInstr* other_op = other->AsStrictCompare();
   ASSERT(other_op != NULL);
@@ -1062,7 +1071,50 @@
 
 
 RawAbstractType* LoadIndexedInstr::CompileType() const {
-  return Type::DynamicType();
+  switch (class_id_) {
+    case kArrayCid:
+    case kGrowableObjectArrayCid:
+    case kImmutableArrayCid:
+      return Type::DynamicType();
+    case kFloat32ArrayCid :
+    case kFloat64ArrayCid :
+      return Type::Double();
+    default:
+      UNIMPLEMENTED();
+      return Type::IntType();
+  }
+}
+
+
+intptr_t LoadIndexedInstr::ResultCid() const {
+  switch (class_id_) {
+    case kArrayCid:
+    case kGrowableObjectArrayCid:
+    case kImmutableArrayCid:
+      return kDynamicCid;
+    case kFloat32ArrayCid :
+    case kFloat64ArrayCid :
+      return kDoubleCid;
+    default:
+      UNIMPLEMENTED();
+      return kSmiCid;
+  }
+}
+
+
+Representation LoadIndexedInstr::representation() const {
+  switch (class_id_) {
+    case kArrayCid:
+    case kGrowableObjectArrayCid:
+    case kImmutableArrayCid:
+      return kTagged;
+    case kFloat32ArrayCid :
+    case kFloat64ArrayCid :
+      return kUnboxedDouble;
+    default:
+      UNIMPLEMENTED();
+      return kTagged;
+  }
 }
 
 
@@ -1071,6 +1123,25 @@
 }
 
 
+Representation StoreIndexedInstr::RequiredInputRepresentation(
+    intptr_t idx) const {
+  if ((idx == 0) || (idx == 1)) return kTagged;
+  ASSERT(idx == 2);
+  switch (class_id_) {
+    case kArrayCid:
+    case kGrowableObjectArrayCid:
+    case kImmutableArrayCid:
+      return kTagged;
+    case kFloat32ArrayCid :
+    case kFloat64ArrayCid :
+      return kUnboxedDouble;
+    default:
+      UNIMPLEMENTED();
+      return kTagged;
+  }
+}
+
+
 RawAbstractType* StoreInstanceFieldInstr::CompileType() const {
   return value()->CompileType();
 }
@@ -1336,6 +1407,38 @@
 }
 
 
+Definition* AssertBooleanInstr::Canonicalize() {
+  const intptr_t value_cid = value()->ResultCid();
+  return (value_cid == kBoolCid) ? value()->definition() : this;
+}
+
+
+Definition* AssertAssignableInstr::Canonicalize() {
+  // (1) Replace the assert with its input if the input has a known compatible
+  // class-id. The class-ids handled here are those that are known to be
+  // results of IL instructions.
+  intptr_t cid = value()->ResultCid();
+  bool is_redundant = false;
+  if (dst_type().IsIntType()) {
+    is_redundant = (cid == kSmiCid) || (cid == kMintCid);
+  } else if (dst_type().IsDoubleType()) {
+    is_redundant = (cid == kDoubleCid);
+  } else if (dst_type().IsBoolType()) {
+    is_redundant = (cid == kBoolCid);
+  }
+  if (is_redundant) return value()->definition();
+
+  // (2) Replace the assert with its input if the input is the result of a
+  // compatible assert itself.
+  AssertAssignableInstr* check = value()->definition()->AsAssertAssignable();
+  if ((check != NULL) && (check->dst_type().raw() == dst_type().raw())) {
+    // TODO(fschneider): Propagate type-assertions across phi-nodes.
+    // TODO(fschneider): Eliminate more asserts with subtype relation.
+    return check;
+  }
+  return this;
+}
+
 Definition* StrictCompareInstr::Canonicalize() {
   if (!right()->BindsToConstant()) return this;
   const Object& right_constant = right()->BoundConstant();
@@ -1353,10 +1456,10 @@
 
 
 Instruction* CheckClassInstr::Canonicalize() {
-  const intptr_t v_cid = value()->ResultCid();
+  const intptr_t value_cid = value()->ResultCid();
   const intptr_t num_checks = unary_checks().NumberOfChecks();
   if ((num_checks == 1) &&
-      (v_cid == unary_checks().GetReceiverClassIdAt(0))) {
+      (value_cid == unary_checks().GetReceiverClassIdAt(0))) {
     // No checks needed.
     return NULL;
   }
@@ -1707,18 +1810,32 @@
 
 
 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  if (!compiler->is_optimizing()) {
+  if (compiler->is_optimizing()) {
+    if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
+      compiler->GenerateInstanceCall(deopt_id(),
+                                     token_pos(),
+                                     function_name(),
+                                     ArgumentCount(),
+                                     argument_names(),
+                                     checked_argument_count(),
+                                     locs());
+    } else {
+      Label* deopt =
+          compiler->AddDeoptStub(deopt_id(), kDeoptInstanceCallNoICData);
+      __ jmp(deopt);
+    }
+  } else {
     compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore,
                                    deopt_id(),
                                    token_pos());
+    compiler->GenerateInstanceCall(deopt_id(),
+                                   token_pos(),
+                                   function_name(),
+                                   ArgumentCount(),
+                                   argument_names(),
+                                   checked_argument_count(),
+                                   locs());
   }
-  compiler->GenerateInstanceCall(deopt_id(),
-                                 token_pos(),
-                                 function_name(),
-                                 ArgumentCount(),
-                                 argument_names(),
-                                 checked_argument_count(),
-                                 locs());
 }
 
 
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index c846045..52d2cfa 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1910,8 +1910,13 @@
 
   virtual bool HasSideEffect() const { return false; }
 
+  virtual bool AffectedBySideEffect() const { return false; }
+  virtual bool AttributesEqual(Instruction* other) const;
+
   virtual intptr_t ResultCid() const { return kDynamicCid; }
 
+  virtual Definition* Canonicalize();
+
  private:
   const intptr_t token_pos_;
   const AbstractType& dst_type_;
@@ -1951,8 +1956,13 @@
 
   virtual bool HasSideEffect() const { return false; }
 
+  virtual bool AffectedBySideEffect() const { return false; }
+  virtual bool AttributesEqual(Instruction* other) const { return true; }
+
   virtual intptr_t ResultCid() const { return kBoolCid; }
 
+  virtual Definition* Canonicalize();
+
  private:
   const intptr_t token_pos_;
   bool is_eliminated_;
@@ -2069,8 +2079,8 @@
     ASSERT(function_name.IsZoneHandle());
     ASSERT(!arguments->is_empty());
     ASSERT(argument_names.IsZoneHandle());
-    ASSERT(Token::IsBinaryToken(token_kind) ||
-           Token::IsUnaryToken(token_kind) ||
+    ASSERT(Token::IsBinaryOperator(token_kind) ||
+           Token::IsPrefixOperator(token_kind) ||
            Token::IsIndexOperator(token_kind) ||
            token_kind == Token::kGET ||
            token_kind == Token::kSET ||
@@ -2103,6 +2113,10 @@
 
   virtual intptr_t ResultCid() const { return kDynamicCid; }
 
+ protected:
+  friend class FlowGraphOptimizer;
+  void set_ic_data(ICData* value) { ic_data_ = value; }
+
  private:
   const ICData* ic_data_;
   const intptr_t token_pos_;
@@ -2658,7 +2672,8 @@
 
 class LoadIndexedInstr : public TemplateDefinition<2> {
  public:
-  LoadIndexedInstr(Value* array, Value* index) {
+  LoadIndexedInstr(Value* array, Value* index, intptr_t class_id)
+      : class_id_(class_id) {
     ASSERT(array != NULL);
     ASSERT(index != NULL);
     inputs_[0] = array;
@@ -2670,14 +2685,19 @@
 
   Value* array() const { return inputs_[0]; }
   Value* index() const { return inputs_[1]; }
+  intptr_t class_id() const { return class_id_; }
 
   virtual bool CanDeoptimize() const { return false; }
 
   virtual bool HasSideEffect() const { return false; }
 
-  virtual intptr_t ResultCid() const { return kDynamicCid; }
+  virtual intptr_t ResultCid() const;
+
+  virtual Representation representation() const;
 
  private:
+  const intptr_t class_id_;
+
   DISALLOW_COPY_AND_ASSIGN(LoadIndexedInstr);
 };
 
@@ -2687,8 +2707,12 @@
   StoreIndexedInstr(Value* array,
                     Value* index,
                     Value* value,
-                    bool emit_store_barrier)
-      : emit_store_barrier_(emit_store_barrier) {
+                    bool emit_store_barrier,
+                    intptr_t class_id,
+                    intptr_t deopt_id)
+      : emit_store_barrier_(emit_store_barrier),
+        class_id_(class_id),
+        deopt_id_(deopt_id) {
     ASSERT(array != NULL);
     ASSERT(index != NULL);
     ASSERT(value != NULL);
@@ -2703,6 +2727,7 @@
   Value* array() const { return inputs_[0]; }
   Value* index() const { return inputs_[1]; }
   Value* value() const { return inputs_[2]; }
+  intptr_t class_id() const { return class_id_; }
 
   bool ShouldEmitStoreBarrier() const {
     return value()->NeedsStoreBuffer() && emit_store_barrier_;
@@ -2714,8 +2739,18 @@
 
   virtual intptr_t ResultCid() const { return kDynamicCid; }
 
+  virtual Representation RequiredInputRepresentation(intptr_t idx) const;
+
+  virtual intptr_t DeoptimizationTarget() const {
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
+    return deopt_id_;
+  }
+
  private:
   const bool emit_store_barrier_;
+  const intptr_t class_id_;
+  const intptr_t deopt_id_;
 
   DISALLOW_COPY_AND_ASSIGN(StoreIndexedInstr);
 };
@@ -3447,8 +3482,8 @@
   }
 
   virtual intptr_t DeoptimizationTarget() const {
-    // Direct access since this instuction cannot deoptimize, and the deopt-id
-    // was inherited from another instuction that could deoptimize.
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
     return deopt_id_;
   }
 
@@ -3503,8 +3538,8 @@
   }
 
   virtual intptr_t DeoptimizationTarget() const {
-    // Direct access since this instuction cannot deoptimize, and the deopt-id
-    // was inherited from another instuction that could deoptimize.
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
     return deopt_id_;
   }
 
@@ -3564,8 +3599,8 @@
   }
 
   virtual intptr_t DeoptimizationTarget() const {
-    // Direct access since this instuction cannot deoptimize, and the deopt-id
-    // was inherited from another instuction that could deoptimize.
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
     return deopt_id_;
   }
 
@@ -3623,8 +3658,8 @@
   }
 
   virtual intptr_t DeoptimizationTarget() const {
-    // Direct access since this instuction cannot deoptimize, and the deopt-id
-    // was inherited from another instuction that could deoptimize.
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
     return deopt_id_;
   }
 
@@ -3678,8 +3713,8 @@
   }
 
   virtual intptr_t DeoptimizationTarget() const {
-    // Direct access since this instuction cannot deoptimize, and the deopt-id
-    // was inherited from another instuction that could deoptimize.
+    // Direct access since this instruction cannot deoptimize, and the deopt-id
+    // was inherited from another instruction that could deoptimize.
     return deopt_id_;
   }
 
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 0e9d611..7fcadfd 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -945,24 +945,28 @@
   locs->set_in(1, CanBeImmediateIndex(index())
                     ? Location::RegisterOrConstant(index())
                     : Location::RequiresRegister());
-  locs->set_out(Location::RequiresRegister());
+  if (representation() == kUnboxedDouble) {
+    locs->set_out(Location::RequiresXmmRegister());
+  } else {
+    locs->set_out(Location::RequiresRegister());
+  }
   return locs;
 }
 
 
 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register array = locs()->in(0).reg();
-  Register result = locs()->out().reg();
   Location index = locs()->in(1);
-  if (index.IsRegister()) {
-    // Note that index is Smi, i.e, times 2.
-    ASSERT(kSmiTagShift == 1);
-    __ movl(result,
-            FieldAddress(array, index.reg(), TIMES_2, sizeof(RawArray)));
+  FieldAddress element_address = index.IsRegister() ?
+      FlowGraphCompiler::ElementAddressForRegIndex(
+          class_id(), array, index.reg()) :
+      FlowGraphCompiler::ElementAddressForIntIndex(
+          class_id(), array, Smi::Cast(index.constant()).Value());
+
+  if (representation() == kUnboxedDouble) {
+    __ movsd(locs()->out().xmm_reg(), element_address);
   } else {
-    const int32_t disp =
-        Smi::Cast(index.constant()).Value() * kWordSize + sizeof(RawArray);
-    __ movl(result, FieldAddress(array, disp));
+    __ movl(locs()->out().reg(), element_address);
   }
 }
 
@@ -976,36 +980,45 @@
   locs->set_in(1, CanBeImmediateIndex(index())
                     ? Location::RegisterOrConstant(index())
                     : Location::RequiresRegister());
-  locs->set_in(2, ShouldEmitStoreBarrier()
-                    ? Location::WritableRegister()
-                    : Location::RegisterOrConstant(value()));
+  if (RequiredInputRepresentation(2) == kUnboxedDouble) {
+    // TODO(srdjan): Support Float64 constants.
+    locs->set_in(2, Location::RequiresXmmRegister());
+  } else {
+    locs->set_in(2, ShouldEmitStoreBarrier()
+                      ? Location::WritableRegister()
+                      : Location::RegisterOrConstant(value()));
+  }
   return locs;
 }
 
 
 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register array = locs()->in(0).reg();
-
-  // Note that index is Smi, i.e, times 2.
-  ASSERT(kSmiTagShift == 1);
   Location index = locs()->in(1);
-  FieldAddress field_address = index.IsConstant()
-      ? FieldAddress(
-          array,
-          Smi::Cast(index.constant()).Value() * kWordSize + sizeof(RawArray))
-      : FieldAddress(array, index.reg(), TIMES_2, sizeof(RawArray));
+
+  FieldAddress element_address = index.IsRegister() ?
+      FlowGraphCompiler::ElementAddressForRegIndex(
+          class_id(), array, index.reg()) :
+      FlowGraphCompiler::ElementAddressForIntIndex(
+          class_id(), array, Smi::Cast(index.constant()).Value());
+
+  if (class_id() == kFloat64ArrayCid) {
+    __ movsd(element_address, locs()->in(2).xmm_reg());
+    return;
+  }
 
   if (ShouldEmitStoreBarrier()) {
     Register value = locs()->in(2).reg();
-    __ StoreIntoObject(array, field_address, value);
+    __ StoreIntoObject(array, element_address, value);
+    return;
+  }
+
+  if (locs()->in(2).IsConstant()) {
+    const Object& constant = locs()->in(2).constant();
+    __ StoreIntoObjectNoBarrier(array, element_address, constant);
   } else {
-    if (locs()->in(2).IsConstant()) {
-      const Object& constant = locs()->in(2).constant();
-      __ StoreIntoObjectNoBarrier(array, field_address, constant);
-    } else {
-      Register value = locs()->in(2).reg();
-      __ StoreIntoObjectNoBarrier(array, field_address, value);
-    }
+    Register value = locs()->in(2).reg();
+    __ StoreIntoObjectNoBarrier(array, element_address, value);
   }
 }
 
@@ -2194,15 +2207,21 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const DeoptReasonId deopt_reason =
       (array_type() == kGrowableObjectArrayCid) ?
-      kDeoptLoadIndexedGrowableArray : kDeoptLoadIndexedFixedArray;
+          kDeoptLoadIndexedGrowableArray : kDeoptLoadIndexedFixedArray;
   Label* deopt = compiler->AddDeoptStub(deopt_id(),
                                         deopt_reason);
-  ASSERT(array_type() == kArrayCid ||
-         array_type() == kImmutableArrayCid ||
-         array_type() == kGrowableObjectArrayCid);
-  intptr_t length_offset = (array_type() == kGrowableObjectArrayCid)
-      ? GrowableObjectArray::length_offset()
-      : Array::length_offset();
+  ASSERT((array_type() == kArrayCid) ||
+         (array_type() == kImmutableArrayCid) ||
+         (array_type() == kGrowableObjectArrayCid) ||
+         (array_type() == kFloat64ArrayCid));
+  intptr_t length_offset = -1;
+  if (array_type() == kGrowableObjectArrayCid) {
+    length_offset = GrowableObjectArray::length_offset();
+  } else if (array_type() == kFloat64ArrayCid) {
+    length_offset = Float64Array::length_offset();
+  } else {
+    length_offset = Array::length_offset();
+  }
   // This case should not have created a bound check instruction.
   ASSERT(!(locs()->in(0).IsConstant() && locs()->in(1).IsConstant()));
 
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index fe61e98..336e932 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -901,26 +901,29 @@
   locs->set_in(1, CanBeImmediateIndex(index())
                     ? Location::RegisterOrConstant(index())
                     : Location::RequiresRegister());
-  locs->set_out(Location::RequiresRegister());
+  if (representation() == kUnboxedDouble) {
+    locs->set_out(Location::RequiresXmmRegister());
+  } else {
+    locs->set_out(Location::RequiresRegister());
+  }
   return locs;
 }
 
 
 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register array = locs()->in(0).reg();
-  Register result = locs()->out().reg();
-
   Location index = locs()->in(1);
-  if (index.IsRegister()) {
-    // Note that index is Smi, i.e, times 4.
-    ASSERT(kSmiTagShift == 1);
-    __ movq(result,
-            FieldAddress(array, index.reg(), TIMES_4, sizeof(RawArray)));
+
+  FieldAddress element_address = index.IsRegister() ?
+      FlowGraphCompiler::ElementAddressForRegIndex(
+          class_id(), array, index.reg()) :
+      FlowGraphCompiler::ElementAddressForIntIndex(
+          class_id(), array, Smi::Cast(index.constant()).Value());
+
+  if (representation() == kUnboxedDouble) {
+    __ movsd(locs()->out().xmm_reg(), element_address);
   } else {
-    const int64_t disp =
-        Smi::Cast(index.constant()).Value() * kWordSize + sizeof(RawArray);
-    ASSERT(Utils::IsInt(32, disp));
-    __ movq(result, FieldAddress(array, static_cast<int32_t>(disp)));
+    __ movq(locs()->out().reg(), element_address);
   }
 }
 
@@ -934,37 +937,44 @@
   locs->set_in(1, CanBeImmediateIndex(index())
                     ? Location::RegisterOrConstant(index())
                     : Location::RequiresRegister());
-  locs->set_in(2, ShouldEmitStoreBarrier()
-                    ? Location::WritableRegister()
-                    : Location::RegisterOrConstant(value()));
+  if (RequiredInputRepresentation(2) == kUnboxedDouble) {
+    // TODO(srdjan): Support Float64 constants.
+    locs->set_in(2, Location::RequiresXmmRegister());
+  } else {
+    locs->set_in(2, ShouldEmitStoreBarrier()
+                      ? Location::WritableRegister()
+                      : Location::RegisterOrConstant(value()));
+  }
   return locs;
 }
 
 
 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register array = locs()->in(0).reg();
-
-  // Note that index is Smi, i.e, times 4.
-  ASSERT(kSmiTagShift == 1);
   Location index = locs()->in(1);
-  FieldAddress field_address = index.IsConstant()
-      ? FieldAddress(
-          array,
-          static_cast<int32_t>(
-            Smi::Cast(index.constant()).Value() * kWordSize + sizeof(RawArray)))
-      : FieldAddress(array, index.reg(), TIMES_4, sizeof(RawArray));
+  FieldAddress element_address = index.IsRegister() ?
+      FlowGraphCompiler::ElementAddressForRegIndex(
+          class_id(), array, index.reg()) :
+      FlowGraphCompiler::ElementAddressForIntIndex(
+          class_id(), array, Smi::Cast(index.constant()).Value());
+
+  if (class_id() == kFloat64ArrayCid) {
+    __ movsd(element_address, locs()->in(2).xmm_reg());
+    return;
+  }
 
   if (ShouldEmitStoreBarrier()) {
       Register value = locs()->in(2).reg();
-    __ StoreIntoObject(array, field_address, value);
+    __ StoreIntoObject(array, element_address, value);
+    return;
+  }
+
+  if (locs()->in(2).IsConstant()) {
+    const Object& constant = locs()->in(2).constant();
+    __ StoreObject(element_address, constant);
   } else {
-    if (locs()->in(2).IsConstant()) {
-      const Object& constant = locs()->in(2).constant();
-      __ StoreObject(field_address, constant);
-    } else {
-      Register value = locs()->in(2).reg();
-      __ StoreIntoObjectNoBarrier(array, field_address, value);
-    }
+    Register value = locs()->in(2).reg();
+    __ StoreIntoObjectNoBarrier(array, element_address, value);
   }
 }
 
@@ -2164,15 +2174,21 @@
 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const DeoptReasonId deopt_reason =
       (array_type() == kGrowableObjectArrayCid) ?
-      kDeoptLoadIndexedGrowableArray : kDeoptLoadIndexedFixedArray;
+          kDeoptLoadIndexedGrowableArray : kDeoptLoadIndexedFixedArray;
   Label* deopt = compiler->AddDeoptStub(deopt_id(),
                                         deopt_reason);
-  ASSERT(array_type() == kArrayCid ||
-         array_type() == kImmutableArrayCid ||
-         array_type() == kGrowableObjectArrayCid);
-  intptr_t length_offset = (array_type() == kGrowableObjectArrayCid)
-      ? GrowableObjectArray::length_offset()
-      : Array::length_offset();
+  ASSERT((array_type() == kArrayCid) ||
+         (array_type() == kImmutableArrayCid) ||
+         (array_type() == kGrowableObjectArrayCid) ||
+         (array_type() == kFloat64ArrayCid));
+  intptr_t length_offset = -1;
+  if (array_type() == kGrowableObjectArrayCid) {
+    length_offset = GrowableObjectArray::length_offset();
+  } else if (array_type() == kFloat64ArrayCid) {
+    length_offset = Float64Array::length_offset();
+  } else {
+    length_offset = Array::length_offset();
+  }
 
   // This case should not have created a bound check instruction.
   ASSERT(!(locs()->in(0).IsConstant() && locs()->in(1).IsConstant()));
diff --git a/runtime/vm/intrinsifier.h b/runtime/vm/intrinsifier.h
index 9b4bc5b..7516dbb 100644
--- a/runtime/vm/intrinsifier.h
+++ b/runtime/vm/intrinsifier.h
@@ -80,11 +80,15 @@
   V(_StringBase, isEmpty, String_isEmpty)                                      \
   V(_ByteArrayBase, get:length, ByteArrayBase_getLength)                       \
   V(_Int8Array, [], Int8Array_getIndexed)                                      \
+  V(_Int8Array, []=, Int8Array_setIndexed)                                     \
   V(_Uint8Array, [], Uint8Array_getIndexed)                                    \
+  V(_Uint8Array, []=, Uint8Array_setIndexed)                                   \
   V(_Int16Array, [], Int16Array_getIndexed)                                    \
   V(_Uint16Array, [], Uint16Array_getIndexed)                                  \
   V(_Int32Array, [], Int32Array_getIndexed)                                    \
   V(_Uint32Array, [], Uint32Array_getIndexed)                                  \
+  V(_Int64Array, [], Int64Array_getIndexed)                                    \
+  V(_Uint64Array, [], Uint64Array_getIndexed)                                  \
   V(_Float32Array, [], Float32Array_getIndexed)                                \
   V(_Float32Array, []=, Float32Array_setIndexed)                               \
   V(_Float64Array, [], Float64Array_getIndexed)                                \
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 76d7f5a..a6056ac 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -406,6 +406,8 @@
   Label fall_through;
   __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Growable array.
   __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Length value.
+  __ testl(EBX, Immediate(kSmiTagMask));
+  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi length.
   __ movl(EDI, FieldAddress(EAX, GrowableObjectArray::data_offset()));
   __ cmpl(EBX, FieldAddress(EDI, Array::length_offset()));
   __ j(ABOVE, &fall_through, Assembler::kNearJump);
@@ -422,13 +424,20 @@
   if (FLAG_enable_type_checks) {
     return false;
   }
-  __ movl(EAX, Address(ESP, + 2 * kWordSize));
-  __ movl(EBX, Address(ESP, + 1 * kWordSize));
+  Label fall_through;
+  __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Data.
+  // Check that data is an ObjectArray.
+  __ testl(EBX, Immediate(kSmiTagMask));
+  __ j(ZERO, &fall_through, Assembler::kNearJump);  // Data is Smi.
+  __ CompareClassId(EBX, kArrayCid, EAX);
+  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+  __ movl(EAX, Address(ESP, + 2 * kWordSize));  // Growable array.
   __ StoreIntoObject(EAX,
                      FieldAddress(EAX, GrowableObjectArray::data_offset()),
                      EBX);
   __ ret();
-  return true;
+  __ Bind(&fall_through);
+  return false;
 }
 
 
@@ -520,6 +529,38 @@
 }
 
 
+bool Intrinsifier::Int8Array_setIndexed(Assembler* assembler) {
+  Label fall_through;
+  // Verify that the array index is valid.
+  TestByteArraySetIndex(assembler, &fall_through);
+  // After TestByteArraySetIndex:
+  // * EAX has the base address of the byte array.
+  // * EBX has the index into the array.
+  // EBX contains the SMI index which is shifted by 1.
+  __ SmiUntag(EBX);
+  // Move EBX into EDI.
+  __ movl(EDI, EBX);
+  // Load the value into EBX.
+  __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Value.
+  // If EBX is not an Smi, jump to fall through.
+  __ testl(EBX, Immediate(kSmiTagMask));
+  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
+  __ SmiUntag(EBX);
+  // Add 128 to EBX to bring it into 0..FF.
+  __ addl(EBX, Immediate(128));
+  __ cmpl(EBX, Immediate(0xFF));
+  // If EBX is too large an Int8, jump to fall through.
+  __ j(ABOVE, &fall_through, Assembler::kNearJump);
+  // Remove addition.
+  __ subl(EBX, Immediate(128));
+  // Store BL into array EAX[EDI] = BL.
+  __ movb(FieldAddress(EAX, EDI, TIMES_1, Int8Array::data_offset()), BL);
+  __ ret();
+  __ Bind(&fall_through);
+  return false;
+}
+
+
 bool Intrinsifier::Uint8Array_getIndexed(Assembler* assembler) {
   Label fall_through;
   TestByteArrayIndex(assembler, &fall_through);
@@ -535,6 +576,34 @@
 }
 
 
+bool Intrinsifier::Uint8Array_setIndexed(Assembler* assembler) {
+  Label fall_through;
+  // Verify that the array index is valid.
+  TestByteArraySetIndex(assembler, &fall_through);
+  // After TestByteArraySetIndex:
+  // * EAX has the base address of the byte array.
+  // * EBX has the index into the array.
+  // EBX contains the SMI index which is shifted by 1.
+  __ SmiUntag(EBX);
+  // Move EBX into EDI.
+  __ movl(EDI, EBX);
+  // Load the value into EBX.
+  __ movl(EBX, Address(ESP, + 1 * kWordSize));  // Value.
+  // If EBX is not an Smi, jump to fall through.
+  __ testl(EBX, Immediate(kSmiTagMask));
+  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);
+  __ SmiUntag(EBX);
+  // If EBX is too large an Uint8, jump to fall through.
+  __ cmpl(EBX, Immediate(0xFF));
+  __ j(ABOVE, &fall_through, Assembler::kNearJump);
+  // Store BL into array EAX[EDI] = BL.
+  __ movb(FieldAddress(EAX, EDI, TIMES_1, Uint8Array::data_offset()), BL);
+  __ ret();
+  __ Bind(&fall_through);
+  return false;
+}
+
+
 bool Intrinsifier::Int16Array_getIndexed(Assembler* assembler) {
   Label fall_through;
   TestByteArrayIndex(assembler, &fall_through);
@@ -564,11 +633,55 @@
 
 
 bool Intrinsifier::Int32Array_getIndexed(Assembler* assembler) {
+  Label fall_through;
+  TestByteArrayIndex(assembler, &fall_through);
+  // After TestByteArrayIndex:
+  // * EAX has the base address of the byte array.
+  // * EBX has the index into the array.
+  // EBX contains the SMI index which is shifted left by 1.
+  // This shift means we only multiply the index by 2 not 4 (sizeof Int32).
+  __ movl(EAX, FieldAddress(EAX,
+                            EBX,
+                            TIMES_2,
+                            Int32Array::data_offset()));
+  // Verify that the signed value in EAX can fit inside a Smi.
+  __ cmpl(EAX, Immediate(0xC0000000));
+  __ j(NEGATIVE, &fall_through, Assembler::kNearJump);  // Won't fit Smi.
+  __ SmiTag(EAX);
+  __ ret();
+  __ Bind(&fall_through);
   return false;
 }
 
 
 bool Intrinsifier::Uint32Array_getIndexed(Assembler* assembler) {
+  Label fall_through;
+  TestByteArrayIndex(assembler, &fall_through);
+  // After TestByteArrayIndex:
+  // * EAX has the base address of the byte array.
+  // * EBX has the index into the array.
+  // EBX contains the SMI index which is shifted left by 1.
+  // This shift means we only multiply the index by 2 not 4 (sizeof Uint32).
+  __ movl(EAX, FieldAddress(EAX,
+                            EBX,
+                            TIMES_2,
+                            Uint32Array::data_offset()));
+    // Verify that the unsigned value in EAX can be stored in a Smi.
+  __ testl(EAX,  Immediate(0xC0000000));
+  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Won't fit Smi.
+  __ SmiTag(EAX);
+  __ ret();
+  __ Bind(&fall_through);
+  return false;
+}
+
+
+bool Intrinsifier::Int64Array_getIndexed(Assembler* assembler) {
+  return false;
+}
+
+
+bool Intrinsifier::Uint64Array_getIndexed(Assembler* assembler) {
   return false;
 }
 
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index e101fae..a1851a6 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -345,6 +345,8 @@
   Label fall_through;
   __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Growable array.
   __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Length value.
+  __ testq(RCX, Immediate(kSmiTagMask));
+  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi length.
   __ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset()));
   __ cmpq(RCX, FieldAddress(RDX, Array::length_offset()));
   __ j(ABOVE, &fall_through, Assembler::kNearJump);
@@ -361,13 +363,19 @@
   if (FLAG_enable_type_checks) {
     return false;
   }
-  __ movq(RAX, Address(RSP, + 2 * kWordSize));
-  __ movq(RBX, Address(RSP, + 1 * kWordSize));
+  Label fall_through;
+  __ movq(RBX, Address(RSP, + 1 * kWordSize));  /// Data.
+  __ testq(RBX, Immediate(kSmiTagMask));
+  __ j(ZERO, &fall_through, Assembler::kNearJump);  // Data is Smi.
+  __ CompareClassId(RBX, kArrayCid);
+  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+  __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Growable array.
   __ StoreIntoObject(RAX,
                      FieldAddress(RAX, GrowableObjectArray::data_offset()),
                      RBX);
   __ ret();
-  return true;
+  __ Bind(&fall_through);
+  return false;
 }
 
 
@@ -461,6 +469,20 @@
 }
 
 
+bool Intrinsifier::Int8Array_setIndexed(Assembler* assembler) {
+  Label fall_through;
+  __ Bind(&fall_through);
+  return false;
+}
+
+
+bool Intrinsifier::Uint8Array_setIndexed(Assembler* assembler) {
+  Label fall_through;
+  __ Bind(&fall_through);
+  return false;
+}
+
+
 bool Intrinsifier::Uint8Array_getIndexed(Assembler* assembler) {
   Label fall_through;
   TestByteArrayIndex(assembler, &fall_through);
@@ -532,6 +554,47 @@
 }
 
 
+bool Intrinsifier::Int64Array_getIndexed(Assembler* assembler) {
+  Label fall_through;
+  TestByteArrayIndex(assembler, &fall_through);
+  __ movq(RAX, FieldAddress(RAX,
+                            R12,
+                            TIMES_4,
+                            Int64Array::data_offset()));
+  // Copy RAX into R12.
+  // We destroy R12 while testing if RAX can fit inside a Smi.
+  __ movq(R12, RAX);
+  // Verify that the signed value in RAX can fit inside a Smi.
+  __ shlq(R12, Immediate(0x1));
+  // Jump to fall_through if it can not.
+  __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
+  __ SmiTag(RAX);
+  __ ret();
+  __ Bind(&fall_through);
+  return false;
+}
+
+
+bool Intrinsifier::Uint64Array_getIndexed(Assembler* assembler) {
+  Label fall_through;
+  TestByteArrayIndex(assembler, &fall_through);
+  __ movq(RAX, FieldAddress(RAX,
+                            R12,
+                            TIMES_4,
+                            Uint64Array::data_offset()));
+  // Copy RAX into R12.
+  // We destroy R12 while testing if RAX can fit inside a Smi.
+  __ movq(R12, RAX);
+  // Verify that the unsigned value in RAX can be stored in a Smi.
+  __ shrq(R12, Immediate(kSmiBits));
+  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Won't fit Smi.
+  __ SmiTag(RAX);
+  __ ret();
+  __ Bind(&fall_through);
+  return false;
+}
+
+
 bool Intrinsifier::Float32Array_getIndexed(Assembler* assembler) {
   Label fall_through;
   TestByteArrayIndex(assembler, &fall_through);
diff --git a/runtime/vm/native_message_handler.cc b/runtime/vm/native_message_handler.cc
index 811b7b0..83bcf5e 100644
--- a/runtime/vm/native_message_handler.cc
+++ b/runtime/vm/native_message_handler.cc
@@ -36,7 +36,7 @@
 static uint8_t* zone_allocator(uint8_t* ptr,
                                intptr_t old_size,
                                intptr_t new_size) {
-  ApiZone* zone = ApiNativeScope::Current()->zone();
+  Zone* zone = ApiNativeScope::Current()->zone();
   return zone->Realloc<uint8_t>(ptr, old_size, new_size);
 }
 
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 9c2d491..4054051 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -2205,6 +2205,10 @@
   ASSERT(name.IsOneByteString());
   const OneByteString& lookup_name = OneByteString::Cast(name);
   Array& funcs = Array::Handle(isolate, functions());
+  if (funcs.IsNull()) {
+    // This can occur, e.g., for Null classes.
+    return Function::null();
+  }
   Function& function = Function::Handle(isolate, Function::null());
   OneByteString& function_name =
       OneByteString::Handle(isolate, OneByteString::null());
@@ -9709,7 +9713,7 @@
 
 
 static uword BigintAllocator(intptr_t size) {
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   return zone->AllocUnsafe(size);
 }
 
@@ -10221,7 +10225,7 @@
   intptr_t len = OS::VSNPrint(NULL, 0, format, args_copy);
   va_end(args_copy);
 
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   char* buffer = zone->Alloc<char>(len + 1);
   OS::VSNPrint(buffer, (len + 1), format, args);
 
@@ -10326,7 +10330,7 @@
 
 const char* String::ToCString() const {
   intptr_t len = Utf8::Length(*this);
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   char* result = zone->Alloc<char>(len + 1);
   Utf8::Encode(*this, result, len);
   result[len] = 0;
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 5bfa0e0..5d9d3ea 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -1269,7 +1269,7 @@
   void set_is_abstract(bool value) const;
 
   bool is_inlinable() const {
-    return InlinableBit::decode(raw_ptr()->kind_tag_);
+    return InlinableBit::decode(raw_ptr()->kind_tag_) && HasCode();
   }
   void set_is_inlinable(bool value) const;
 
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index d33e153..23538a7 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -31,7 +31,6 @@
   result->memory_ = memory;
   result->next_ = NULL;
   result->used_ = 0;
-  result->top_ = result->first_object_start();
   return result;
 }
 
@@ -50,8 +49,8 @@
 
 
 void HeapPage::VisitObjects(ObjectVisitor* visitor) const {
-  uword obj_addr = first_object_start();
-  uword end_addr = top();
+  uword obj_addr = object_start();
+  uword end_addr = object_end();
   while (obj_addr < end_addr) {
     RawObject* raw_obj = RawObject::FromAddr(obj_addr);
     visitor->VisitObject(raw_obj);
@@ -62,8 +61,8 @@
 
 
 void HeapPage::VisitObjectPointers(ObjectPointerVisitor* visitor) const {
-  uword obj_addr = first_object_start();
-  uword end_addr = top();
+  uword obj_addr = object_start();
+  uword end_addr = object_end();
   while (obj_addr < end_addr) {
     RawObject* raw_obj = RawObject::FromAddr(obj_addr);
     obj_addr += raw_obj->VisitPointers(visitor);
@@ -73,8 +72,8 @@
 
 
 RawObject* HeapPage::FindObject(FindObjectVisitor* visitor) const {
-  uword obj_addr = first_object_start();
-  uword end_addr = top();
+  uword obj_addr = object_start();
+  uword end_addr = object_end();
   while (obj_addr < end_addr) {
     RawObject* raw_obj = RawObject::FromAddr(obj_addr);
     if (raw_obj->FindObject(visitor)) {
@@ -99,7 +98,6 @@
       pages_(NULL),
       pages_tail_(NULL),
       large_pages_(NULL),
-      bump_page_(NULL),
       max_capacity_(max_capacity),
       capacity_(0),
       in_use_(0),
@@ -125,7 +123,7 @@
 }
 
 
-void PageSpace::AllocatePage() {
+HeapPage* PageSpace::AllocatePage() {
   HeapPage* page = HeapPage::Allocate(kPageSize, is_executable_);
   if (pages_ == NULL) {
     pages_ = page;
@@ -133,8 +131,9 @@
     pages_tail_->set_next(page);
   }
   pages_tail_ = page;
-  bump_page_ = NULL;  // Reenable scanning of pages for bump allocation.
   capacity_ += kPageSize;
+  page->set_object_end(page->memory_->end());
+  return page;
 }
 
 
@@ -144,6 +143,8 @@
   page->set_next(large_pages_);
   large_pages_ = page;
   capacity_ += page_size;
+  // Only one object in this page.
+  page->set_object_end(page->object_start() + size);
   return page;
 }
 
@@ -186,32 +187,6 @@
 }
 
 
-uword PageSpace::TryBumpAllocate(intptr_t size) {
-  if (pages_tail_ == NULL) {
-    return 0;
-  }
-  uword result = pages_tail_->TryBumpAllocate(size);
-  if (result != 0) {
-    return result;
-  }
-  if (bump_page_ == NULL) {
-    // The bump page has not yet been used: Start at the beginning of the list.
-    bump_page_ = pages_;
-  }
-  // The last page has already been attempted above.
-  while (bump_page_ != pages_tail_) {
-    ASSERT(bump_page_->next() != NULL);
-    result = bump_page_->TryBumpAllocate(size);
-    if (result != 0) {
-      return result;
-    }
-    bump_page_ = bump_page_->next();
-  }
-  // Ran through all of the pages trying to bump allocate: Give up.
-  return 0;
-}
-
-
 uword PageSpace::TryAllocate(intptr_t size) {
   return TryAllocate(size, kControlGrowth);
 }
@@ -223,16 +198,17 @@
   uword result = 0;
   if (size < kAllocatablePageSize) {
     result = freelist_.TryAllocate(size);
-    if (result == 0) {
-      result = TryBumpAllocate(size);
-      if ((result == 0) &&
-          (page_space_controller_.CanGrowPageSpace(size) ||
-           growth_policy == kForceGrowth) &&
-          CanIncreaseCapacity(kPageSize)) {
-        AllocatePage();
-        result = TryBumpAllocate(size);
-        ASSERT(result != 0);
-      }
+    if ((result == 0) &&
+        (page_space_controller_.CanGrowPageSpace(size) ||
+         growth_policy == kForceGrowth) &&
+        CanIncreaseCapacity(kPageSize)) {
+      HeapPage* page = AllocatePage();
+      ASSERT(page != NULL);
+      // Start of the newly allocated page is the allocated object.
+      result = page->object_start();
+      // Enqueue the remainder in the free list.
+      uword free_start = result + size;
+      freelist_.Free(free_start, page->object_end() - free_start);
     }
   } else {
     // Large page allocation.
@@ -244,14 +220,14 @@
     if (CanIncreaseCapacity(page_size)) {
       HeapPage* page = AllocateLargePage(size);
       if (page != NULL) {
-        result = page->top();
-        page->set_top(result + size);
+        result = page->object_start();
       }
     }
   }
   if (result != 0) {
     in_use_ += size;
   }
+  ASSERT((result & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
   return result;
 }
 
@@ -281,12 +257,12 @@
   *start = static_cast<uword>(~0);
   *end = 0;
   for (HeapPage* page = pages_; page != NULL; page = page->next()) {
-    *start = Utils::Minimum(*start, page->start());
-    *end = Utils::Maximum(*end, page->end());
+    *start = Utils::Minimum(*start, page->object_start());
+    *end = Utils::Maximum(*end, page->object_end());
   }
   for (HeapPage* page = large_pages_; page != NULL; page = page->next()) {
-    *start = Utils::Minimum(*start, page->start());
-    *end = Utils::Maximum(*end, page->end());
+    *start = Utils::Minimum(*start, page->object_start());
+    *end = Utils::Maximum(*end, page->object_end());
   }
   ASSERT(*start != static_cast<uword>(~0));
   ASSERT(*end != 0);
@@ -409,7 +385,6 @@
   marker.MarkObjects(isolate, this, invoke_api_callbacks);
 
   // Reset the bump allocation page to unused.
-  bump_page_ = NULL;
   // Reset the freelists and setup sweeping.
   freelist_.Reset();
   GCSweeper sweeper(heap_);
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index 48b216f..3ce7511 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -28,15 +28,12 @@
     return memory_->Contains(addr);
   }
 
-  uword start() const { return reinterpret_cast<uword>(this); }
-  uword end() const { return memory_->end(); }
-
-  uword top() const { return top_; }
-  void set_top(uword top) { top_ = top; }
-
-  uword first_object_start() const {
+  uword object_start() const {
     return (reinterpret_cast<uword>(this) + sizeof(HeapPage));
   }
+  uword object_end() const {
+    return object_end_;
+  }
 
   void set_used(uword used) { used_ = used; }
   uword used() const { return used_; }
@@ -44,16 +41,6 @@
     used_ += size;
   }
 
-  uword TryBumpAllocate(intptr_t size) {
-    uword result = top();
-    intptr_t remaining_space = end() - result;
-    if (remaining_space < size) {
-      return 0;
-    }
-    set_top(result + size);
-    return result;
-  }
-
   void VisitObjects(ObjectVisitor* visitor) const;
   void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
 
@@ -62,6 +49,11 @@
   void WriteProtect(bool read_only);
 
  private:
+  void set_object_end(uword val) {
+    ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
+    object_end_ = val;
+  }
+
   static HeapPage* Initialize(VirtualMemory* memory, bool is_executable);
   static HeapPage* Allocate(intptr_t size, bool is_executable);
 
@@ -72,7 +64,7 @@
   VirtualMemory* memory_;
   HeapPage* next_;
   uword used_;
-  uword top_;
+  uword object_end_;
 
   friend class PageSpace;
 
@@ -216,7 +208,7 @@
  private:
   static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
 
-  void AllocatePage();
+  HeapPage* AllocatePage();
   void FreePage(HeapPage* page, HeapPage* previous_page);
   HeapPage* AllocateLargePage(intptr_t size);
   void FreeLargePage(HeapPage* page, HeapPage* previous_page);
@@ -229,8 +221,6 @@
     return increase <= (max_capacity_ - capacity_);
   }
 
-  uword TryBumpAllocate(intptr_t size);
-
   FreeList freelist_;
 
   Heap* heap_;
@@ -241,13 +231,6 @@
 
   PeerTable peer_table_;
 
-  // Page being used for bump allocation.
-  // The value has different meanings:
-  // NULL: Still bump allocating from last allocated fresh page.
-  // !NULL: Last page that had enough room to bump allocate, when we reach the
-  // tail page, we give up bump allocating.
-  HeapPage* bump_page_;
-
   // Various sizes being tracked for this generation.
   intptr_t max_capacity_;
   intptr_t capacity_;
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 4208eec..29e6c29 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -22,8 +22,6 @@
 
 namespace dart {
 
-DEFINE_FLAG(bool, constructor_name_check, false,
-            "Named constructors may not clash with other members");
 DEFINE_FLAG(bool, enable_asserts, false, "Enable assert statements.");
 DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks.");
 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
@@ -33,6 +31,8 @@
             "Warning on legacy map literal syntax (single type argument)");
 DEFINE_FLAG(bool, warn_legacy_dynamic, false,
             "Warning on legacy type Dynamic)");
+DEFINE_FLAG(bool, warn_legacy_getters, false,
+            "Warning on legacy getter syntax");
 
 static void CheckedModeHandler(bool value) {
   FLAG_enable_asserts = value;
@@ -487,6 +487,7 @@
     has_var = false;
     has_factory = false;
     has_operator = false;
+    operator_token = Token::kILLEGAL;
     type = NULL;
     name_pos = 0;
     name = NULL;
@@ -518,6 +519,7 @@
   bool has_var;
   bool has_factory;
   bool has_operator;
+  Token::Kind operator_token;
   const AbstractType* type;
   intptr_t name_pos;
   String* name;
@@ -1461,10 +1463,17 @@
       super_op = new StaticCallNode(
           operator_pos, assign_index_operator, operator_args);
     }
-  } else if (Token::CanBeOverloaded(CurrentToken())) {
+  } else if (Token::CanBeOverloaded(CurrentToken()) ||
+             (CurrentToken() == Token::kNE)) {
     Token::Kind op = CurrentToken();
     ConsumeToken();
 
+    bool negate_result = false;
+    if (op == Token::kNE) {
+      op = Token::kEQ;
+      negate_result = true;
+    }
+
     // Resolve the operator function in the superclass.
     const String& operator_function_name =
         String::Handle(Symbols::New(Token::Str(op)));
@@ -1490,6 +1499,9 @@
                                                 *op_arguments);
     }
     super_op = new StaticCallNode(operator_pos, super_operator, op_arguments);
+    if (negate_result) {
+      super_op = new UnaryOpNode(operator_pos, Token::kNOT, super_op);
+    }
   }
   return super_op;
 }
@@ -1846,8 +1858,9 @@
   ASSERT(phase_param != NULL);
   AstNode* phase_argument = new LoadLocalNode(call_pos, phase_param);
   arguments->Add(phase_argument);
+  receiver->set_invisible(true);
   ParseActualParameters(arguments, kAllowConst);
-
+  receiver->set_invisible(false);
   // Resolve the constructor.
   const Function& redirect_ctor = Function::ZoneHandle(
       cls.LookupConstructor(ctor_name));
@@ -2438,6 +2451,9 @@
     // TODO(hausner): Remove this once the old getter syntax with
     // empty parameter list is no longer supported.
     if (CurrentToken() == Token::kLPAREN) {
+      if (FLAG_warn_legacy_getters) {
+        Warning("legacy getter syntax, remove parenthesis");
+      }
       ConsumeToken();
       ExpectToken(Token::kRPAREN);
     }
@@ -2445,12 +2461,15 @@
 
   // Now that we know the parameter list, we can distinguish between the
   // unary and binary operator -.
-  if (method->has_operator &&
-      method->name->Equals("-") &&
-      (method->params.num_fixed_parameters == 1)) {
-    // Patch up name for unary operator - so it does not clash with the
-    // name for binary operator -.
-    *method->name = Symbols::New("unary-");
+  if (method->has_operator) {
+    if ((method->operator_token == Token::kSUB) &&
+       (method->params.num_fixed_parameters == 1)) {
+      // Patch up name for unary operator - so it does not clash with the
+      // name for binary operator -.
+      method->operator_token = Token::kNEGATE;
+      *method->name = Symbols::New(Token::Str(Token::kNEGATE));
+    }
+    CheckOperatorArity(*method);
   }
 
   if (members->FunctionNameExists(*method->name, method->kind)) {
@@ -2811,19 +2830,12 @@
 }
 
 
-void Parser::CheckOperatorArity(const MemberDesc& member,
-                                Token::Kind operator_token) {
+void Parser::CheckOperatorArity(const MemberDesc& member) {
   intptr_t expected_num_parameters;  // Includes receiver.
-  if (operator_token == Token::kASSIGN_INDEX) {
+  Token::Kind op = member.operator_token;
+  if (op == Token::kASSIGN_INDEX) {
     expected_num_parameters = 3;
-  } else if (operator_token == Token::kSUB) {
-    if (member.params.num_fixed_parameters == 1) {
-      // Unary operator minus (i.e. negate).
-      expected_num_parameters = 1;
-    } else {
-      expected_num_parameters = 2;
-    }
-  } else if (operator_token == Token::kBIT_NOT) {
+  } else if ((op == Token::kBIT_NOT) || (op == Token::kNEGATE)) {
     expected_num_parameters = 1;
   } else {
     expected_num_parameters = 2;
@@ -2917,7 +2929,7 @@
       }
     }
   }
-  Token::Kind operator_token = Token::kILLEGAL;
+
   // Optionally parse a (possibly named) constructor name or factory.
   if (IsIdentifier() &&
       (CurrentLiteral()->Equals(members->class_name()) || member.has_factory)) {
@@ -3014,12 +3026,12 @@
     if (member.has_static) {
       ErrorMsg("operator overloading functions cannot be static");
     }
-    operator_token = CurrentToken();
+    member.operator_token = CurrentToken();
     member.has_operator = true;
     member.kind = RawFunction::kRegularFunction;
     member.name_pos = this->TokenPos();
     member.name =
-        &String::ZoneHandle(Symbols::New(Token::Str(operator_token)));
+        &String::ZoneHandle(Symbols::New(Token::Str(member.operator_token)));
     ConsumeToken();
   } else if (IsIdentifier()) {
     member.name = CurrentLiteral();
@@ -3044,9 +3056,6 @@
     }
     ASSERT(member.IsFactory() == member.has_factory);
     ParseMethodOrConstructor(members, &member);
-    if (member.has_operator) {
-      CheckOperatorArity(member, operator_token);
-    }
   } else if (CurrentToken() ==  Token::kSEMICOLON ||
              CurrentToken() == Token::kCOMMA ||
              CurrentToken() == Token::kASSIGN) {
@@ -3253,7 +3262,8 @@
   for (int i = 0; i < members.length(); i++) {
     MemberDesc* member = &members[i];
 
-    if (FLAG_constructor_name_check && member->constructor_name != NULL) {
+    if (member->constructor_name != NULL) {
+      // Check whether constructor name conflicts with a member name.
       if (class_desc->FunctionNameExists(
           *member->constructor_name, member->kind)) {
         ErrorMsg(member->name_pos,
@@ -4003,7 +4013,11 @@
 
   const intptr_t accessor_pos = TokenPos();
   ParamList params;
-  // TODO(hausner): Remove the ( check once we remove old getter syntax.
+  if (FLAG_warn_legacy_getters &&
+      is_getter && (CurrentToken() == Token::kLPAREN)) {
+    Warning("legacy getter syntax, remove parenthesis");
+  }
+  // TODO(hausner): Remove the kLPAREN check once we remove old getter syntax.
   if (!is_getter || (CurrentToken() == Token::kLPAREN)) {
     const bool allow_explicit_default_values = true;
     ParseFormalParameterList(allow_explicit_default_values, &params);
@@ -5880,8 +5894,6 @@
 }
 
 
-// TODO(hausner): This structure can be simplified once the old catch
-// syntax is removed. All catch parameters in the new syntax are final.
 struct CatchParamDesc {
   CatchParamDesc()
       : token_pos(0), type(NULL), var(NULL) { }
@@ -6617,12 +6629,12 @@
 }
 
 
-bool Parser::IsIncrementOperator(Token::Kind token) {
+static bool IsIncrementOperator(Token::Kind token) {
   return token == Token::kINCR || token == Token::kDECR;
 }
 
 
-bool Parser::IsPrefixOperator(Token::Kind token) {
+static bool IsPrefixOperator(Token::Kind token) {
   return (token == Token::kTIGHTADD) ||   // Valid for literals only!
          (token == Token::kSUB) ||
          (token == Token::kNOT) ||
@@ -7095,6 +7107,9 @@
   const intptr_t op_pos = TokenPos();
   if (IsPrefixOperator(CurrentToken())) {
     Token::Kind unary_op = CurrentToken();
+    if (unary_op == Token::kSUB) {
+      unary_op = Token::kNEGATE;
+    }
     ConsumeToken();
     expr = ParseUnaryExpr();
     if (unary_op == Token::kTIGHTADD) {
@@ -9423,7 +9438,8 @@
         primary = ParseSuperFieldAccess(ident);
       }
     } else if ((CurrentToken() == Token::kLBRACK) ||
-        Token::CanBeOverloaded(CurrentToken())) {
+        Token::CanBeOverloaded(CurrentToken()) ||
+        (CurrentToken() == Token::kNE)) {
       primary = ParseSuperOperator();
     } else {
       ErrorMsg("illegal super call");
@@ -9627,6 +9643,12 @@
     case Token::kINDEX:
       SkipCompoundLiteral();
       break;
+    case Token::kCONDITIONAL:
+      ConsumeToken();
+      if (IsIdentifier()) {
+        ConsumeToken();
+      }
+      break;
     default:
       if (IsIdentifier()) {
         ConsumeToken();  // Handle pseudo-keyword identifiers.
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 61d190f..d6e7375 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -20,7 +20,7 @@
 class TokenStream;
 
 struct TopLevel;
-struct ClassDesc;
+class ClassDesc;
 struct MemberDesc;
 struct ParamList;
 struct QualIdent;
@@ -544,9 +544,6 @@
 
   static bool IsAssignableExpr(AstNode* expr);
 
-  static bool IsPrefixOperator(Token::Kind token);
-  static bool IsIncrementOperator(Token::Kind token);
-
   static SequenceNode* NodeAsSequenceNode(intptr_t sequence_pos,
                                           AstNode* node,
                                           LocalScope* scope);
@@ -561,7 +558,7 @@
   AstNode* ThrowNoSuchMethodError(intptr_t call_pos, const String& name);
 
   void CheckFunctionIsCallable(intptr_t token_pos, const Function& function);
-  void CheckOperatorArity(const MemberDesc& member, Token::Kind operator_token);
+  void CheckOperatorArity(const MemberDesc& member);
 
   const LocalVariable* GetIncrementTempLocal();
   void EnsureExpressionTemp();
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 55a8e97..842b1a5 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -23,7 +23,7 @@
 
 
 static uword BigintAllocator(intptr_t size) {
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   return zone->AllocUnsafe(size);
 }
 
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 1bf149b..e7d127a 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -58,7 +58,7 @@
 
 static uint8_t* zone_allocator(
     uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   return zone->Realloc<uint8_t>(ptr, old_size, new_size);
 }
 
@@ -416,7 +416,6 @@
   free(const_cast<char*>(str2));
 
   // Read object back from the snapshot into a C structure.
-  ApiNativeScope scope;
   ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
   Dart_CObject* root = api_reader.ReadMessage();
   // Bigint not supported.
@@ -428,6 +427,7 @@
 
 void CheckBigint(const char* bigint_value) {
   StackZone zone(Isolate::Current());
+  ApiNativeScope scope;
 
   Bigint& bigint = Bigint::Handle();
   bigint ^= BigintOperations::NewFromCString(bigint_value);
diff --git a/runtime/vm/snapshot_test.dart b/runtime/vm/snapshot_test.dart
index 2812b40..02fbb19 100644
--- a/runtime/vm/snapshot_test.dart
+++ b/runtime/vm/snapshot_test.dart
@@ -1086,7 +1086,7 @@
 
   static void main() {
     init();
-    PingPongGame pingPongGame = new PingPongGame.play();
+    PingPongGame pingPongGame = new PingPongGame();
   }
 
   static var _run;
@@ -1095,7 +1095,7 @@
 
 class PingPongGame {
 
-  PingPongGame.play()
+  PingPongGame()
       : _ping = new ReceivePort(),
         _pingPort = _ping.toSendPort(),
         _pong = null,
@@ -1125,7 +1125,7 @@
       shutdown();
       Benchmark1.add_result((1.0 * _iterations * Benchmark1.MESSAGES) / time);
       if (Benchmark1.run() < Benchmark1.RUNS) {
-        new PingPongGame.play();
+        new PingPongGame();
       } else {
         print("PingPong: ", Benchmark1.get_result());
       }
@@ -1412,7 +1412,7 @@
       if (count == 10) {
         remote.send(-1, reply);
       }
-    }, count: 11));
+    }, 11));
     remote.send(count++, reply);
   });
 }
diff --git a/runtime/vm/symbols.cc b/runtime/vm/symbols.cc
index 325f7d3a..bfb2bea 100644
--- a/runtime/vm/symbols.cc
+++ b/runtime/vm/symbols.cc
@@ -96,7 +96,7 @@
 RawString* Symbols::New(const char* str) {
   intptr_t width = 0;
   intptr_t len = Utf8::CodePointCount(str, &width);
-  StackZone* zone = Isolate::Current()->current_zone();
+  Zone* zone = Isolate::Current()->current_zone();
   if (len == 0) {
     return Symbols::New(reinterpret_cast<uint8_t*>(NULL), 0);
   } else if (width == 1) {
diff --git a/runtime/vm/token.cc b/runtime/vm/token.cc
index b1c75fa..2289718 100644
--- a/runtime/vm/token.cc
+++ b/runtime/vm/token.cc
@@ -37,7 +37,7 @@
 #undef TOKEN_ATTRIBUTE
 
 
-bool Token::IsBinaryToken(Token::Kind token) {
+bool Token::IsBinaryOperator(Token::Kind token) {
   switch (token) {
     case Token::kADD:
     case Token::kSUB:
@@ -59,8 +59,8 @@
 }
 
 
-bool Token::IsUnaryToken(Token::Kind token) {
-  return (token == Token::kNEGATE) || (token == kBIT_NOT);
+bool Token::IsPrefixOperator(Token::Kind token) {
+  return (token == kNOT) || (token == kBIT_NOT) || (token == kNEGATE);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/token.h b/runtime/vm/token.h
index bf7c0c3..a4d1d9f 100644
--- a/runtime/vm/token.h
+++ b/runtime/vm/token.h
@@ -115,6 +115,7 @@
                                                                                \
   TOK(kINDEX, "[]", 0, kNoAttribute)                                           \
   TOK(kASSIGN_INDEX, "[]=", 0, kNoAttribute)                                   \
+  TOK(kNEGATE, "unary-", 0, kNoAttribute)                                      \
                                                                                \
   TOK(kIDENT, "", 0, kNoAttribute)                                             \
   TOK(kSTRING, "", 0, kNoAttribute)                                            \
@@ -166,7 +167,6 @@
   KW(kIN, "in", 0, kKeyword)                                                   \
   KW(kINTERFACE, "interface", 0, kPseudoKeyword)                               \
   KW(kIS, "is", 10, kKeyword)                                                  \
-  KW(kNEGATE, "negate", 0, kPseudoKeyword)                                     \
   KW(kNEW, "new", 0, kKeyword)                                                 \
   KW(kNULL, "null", 0, kKeyword)                                               \
   KW(kOPERATOR, "operator", 0, kPseudoKeyword)                                 \
@@ -286,8 +286,8 @@
             (tok == Token::kDOUBLE));
   }
 
-  static bool IsBinaryToken(Token::Kind token);
-  static bool IsUnaryToken(Token::Kind token);
+  static bool IsBinaryOperator(Token::Kind token);
+  static bool IsPrefixOperator(Token::Kind token);
 
  private:
   static const char* name_[];
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index 461fd87..5227b16 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -79,7 +79,8 @@
       limit_(initial_buffer_.end()),
       head_(NULL),
       large_segments_(NULL),
-      handles_() {
+      handles_(),
+      previous_(NULL) {
 #ifdef DEBUG
     // Zap the entire initial buffer.
   memset(initial_buffer_.pointer(), kZapUninitializedByte,
@@ -206,24 +207,20 @@
 
 StackZone::StackZone(BaseIsolate* isolate)
     : StackResource(isolate),
-      zone_(),
-      previous_(NULL) {
-  // Assert that there is no current zone as we only want to scope
-  // zones when transitioning from generated dart code to dart VM
-  // runtime code.
-  previous_ = isolate->current_zone();
-  isolate->set_current_zone(this);
+      zone_() {
+  zone_.Link(isolate->current_zone());
+  isolate->set_current_zone(&zone_);
 }
 
 
 StackZone::~StackZone() {
-  ASSERT(isolate()->current_zone() == this);
-  isolate()->set_current_zone(previous_);
+  ASSERT(isolate()->current_zone() == &zone_);
+  isolate()->set_current_zone(zone_.previous_);
 }
 
 
-void StackZone::VisitObjectPointers(ObjectPointerVisitor* visitor) {
-  StackZone* zone = this;
+void Zone::VisitObjectPointers(ObjectPointerVisitor* visitor) {
+  Zone* zone = this;
   while (zone != NULL) {
     zone->handles()->VisitObjectPointers(visitor);
     zone = zone->previous_;
@@ -231,7 +228,7 @@
 }
 
 
-char* StackZone::PrintToString(const char* format, ...) {
+char* Zone::PrintToString(const char* format, ...) {
   va_list args;
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
diff --git a/runtime/vm/zone.h b/runtime/vm/zone.h
index fbafa89..f8a2d23 100644
--- a/runtime/vm/zone.h
+++ b/runtime/vm/zone.h
@@ -17,10 +17,7 @@
 // support deallocating all chunks in one fast operation.
 
 class Zone {
- private:
-  Zone();
-  ~Zone();  // Delete all memory associated with the zone.
-
+ public:
   // Allocate an array sized to hold 'len' elements of type
   // 'ElementType'.  Checks for integer overflow when performing the
   // size computation.
@@ -43,12 +40,25 @@
   // responsible for avoiding integer overflow yourself.
   inline uword AllocUnsafe(intptr_t size);
 
+
+  // Make a copy of the string in the zone allocated area.
+  char* MakeCopyOfString(const char* str);
+
+  // Make a zone-allocated string based on printf format and args.
+  char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+
   // Compute the total size of this zone. This includes wasted space that is
   // due to internal fragmentation in the segments.
   intptr_t SizeInBytes() const;
 
-  // Make a copy of the string in the zone allocated area.
-  char* MakeCopyOfString(const char* str);
+  // Structure for managing handles allocation.
+  VMHandles* handles() { return &handles_; }
+
+  void VisitObjectPointers(ObjectPointerVisitor* visitor);
+
+ private:
+  Zone();
+  ~Zone();  // Delete all memory associated with the zone.
 
   // All pointers returned from AllocateUnsafe() and New() have this alignment.
   static const intptr_t kAlignment = kWordSize;
@@ -71,6 +81,11 @@
   // Allocate a large segment.
   uword AllocateLargeSegment(intptr_t size);
 
+  // Insert zone into zone chain, after current_zone.
+  void Link(Zone* current_zone) {
+    previous_ = current_zone;
+  }
+
   // Delete all objects and free all memory allocated in the zone.
   void DeleteAll();
 
@@ -105,7 +120,9 @@
 
   // Structure for managing handles allocation.
   VMHandles handles_;
-  VMHandles* handles() { return &handles_; }
+
+  // Used for chaining zones in order to allow unwinding of stacks.
+  Zone* previous_;
 
   friend class StackZone;
   friend class ApiZone;
@@ -122,55 +139,15 @@
   // Delete all memory associated with the zone.
   ~StackZone();
 
-  // Allocates an array sized to hold 'len' elements of type
-  // 'ElementType'.  Checks for integer overflow when performing the
-  // size computation.
-  template <class ElementType>
-  ElementType* Alloc(intptr_t len) { return zone_.Alloc<ElementType>(len); }
-
-  // Allocates an array sized to hold 'len' elements of type
-  // 'ElementType'.  The new array is initialized from the memory of
-  // 'old_array' up to 'old_len'.
-  template <class ElementType>
-  ElementType* Realloc(ElementType* old_array,
-                       intptr_t old_len,
-                       intptr_t new_len) {
-    return zone_.Realloc<ElementType>(old_array, old_len, new_len);
-  }
-
-  // Allocates 'size' bytes of memory in the zone; expands the zone by
-  // allocating new segments of memory on demand using 'new'.
-  //
-  // It is preferred to use Alloc<T>() instead, as that function can
-  // check for integer overflow.  If you use AllocUnsafe, you are
-  // responsible for avoiding integer overflow yourself.
-  uword AllocUnsafe(intptr_t size) { return zone_.AllocUnsafe(size); }
-
   // Compute the total size of this zone. This includes wasted space that is
   // due to internal fragmentation in the segments.
   intptr_t SizeInBytes() const { return zone_.SizeInBytes(); }
 
-  // Make a copy of the string in the zone allocated area.
-  char* MakeCopyOfString(const char* str) {
-    return zone_.MakeCopyOfString(str);
-  }
-
-  // Make a zone-allocated string based on printf format and args.
-  char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
-
-  // TODO(tball): remove once zone refactoring is finished.
-  VMHandles* handles() { return zone_.handles(); }
-
-  void VisitObjectPointers(ObjectPointerVisitor* visitor);
+  Zone* GetZone() { return &zone_; }
 
  private:
-  Zone* GetBaseZone() { return &zone_; }
-
   Zone zone_;
 
-  // Used for chaining zones in order to allow unwinding of stacks.
-  StackZone* previous_;
-
   template<typename T> friend class GrowableArray;
   template<typename T> friend class ZoneGrowableArray;
 
diff --git a/runtime/vm/zone_test.cc b/runtime/vm/zone_test.cc
index e3e1bd7..5d2f7b1 100644
--- a/runtime/vm/zone_test.cc
+++ b/runtime/vm/zone_test.cc
@@ -20,52 +20,53 @@
   EXPECT(Isolate::Current() == isolate);
   EXPECT(isolate->current_zone() == NULL);
   {
-    StackZone zone(isolate);
+    StackZone stack_zone(isolate);
     EXPECT(isolate->current_zone() != NULL);
+    Zone* zone = stack_zone.GetZone();
     intptr_t allocated_size = 0;
 
     // The loop is to make sure we overflow one segment and go on
     // to the next segment.
     for (int i = 0; i < 1000; i++) {
-      uword first = zone.AllocUnsafe(2 * kWordSize);
-      uword second = zone.AllocUnsafe(3 * kWordSize);
+      uword first = zone->AllocUnsafe(2 * kWordSize);
+      uword second = zone->AllocUnsafe(3 * kWordSize);
       EXPECT(first != second);
       allocated_size = ((2 + 3) * kWordSize);
     }
-    EXPECT_LE(allocated_size, zone.SizeInBytes());
+    EXPECT_LE(allocated_size, zone->SizeInBytes());
 
     // Test for allocation of large segments.
     const uword kLargeSize = 1 * MB;
     const uword kSegmentSize = 64 * KB;
     ASSERT(kLargeSize > kSegmentSize);
     for (int i = 0; i < 10; i++) {
-      EXPECT(zone.AllocUnsafe(kLargeSize) != 0);
+      EXPECT(zone->AllocUnsafe(kLargeSize) != 0);
       allocated_size += kLargeSize;
     }
-    EXPECT_LE(allocated_size, zone.SizeInBytes());
+    EXPECT_LE(allocated_size, zone->SizeInBytes());
 
     // Test corner cases of kSegmentSize.
     uint8_t* buffer = NULL;
     buffer = reinterpret_cast<uint8_t*>(
-        zone.AllocUnsafe(kSegmentSize - kWordSize));
+        zone->AllocUnsafe(kSegmentSize - kWordSize));
     EXPECT(buffer != NULL);
     buffer[(kSegmentSize - kWordSize) - 1] = 0;
     allocated_size += (kSegmentSize - kWordSize);
-    EXPECT_LE(allocated_size, zone.SizeInBytes());
+    EXPECT_LE(allocated_size, zone->SizeInBytes());
 
     buffer = reinterpret_cast<uint8_t*>(
-        zone.AllocUnsafe(kSegmentSize - (2 * kWordSize)));
+        zone->AllocUnsafe(kSegmentSize - (2 * kWordSize)));
     EXPECT(buffer != NULL);
     buffer[(kSegmentSize - (2 * kWordSize)) - 1] = 0;
     allocated_size += (kSegmentSize - (2 * kWordSize));
-    EXPECT_LE(allocated_size, zone.SizeInBytes());
+    EXPECT_LE(allocated_size, zone->SizeInBytes());
 
     buffer = reinterpret_cast<uint8_t*>(
-        zone.AllocUnsafe(kSegmentSize + kWordSize));
+        zone->AllocUnsafe(kSegmentSize + kWordSize));
     EXPECT(buffer != NULL);
     buffer[(kSegmentSize + kWordSize) - 1] = 0;
     allocated_size += (kSegmentSize + kWordSize);
-    EXPECT_LE(allocated_size, zone.SizeInBytes());
+    EXPECT_LE(allocated_size, zone->SizeInBytes());
   }
   EXPECT(isolate->current_zone() == NULL);
   isolate->Shutdown();
@@ -86,7 +87,7 @@
     intptr_t allocated_size = 0;
 
     const intptr_t kNumElements = 1000;
-    zone.Alloc<uint32_t>(kNumElements);
+    zone.GetZone()->Alloc<uint32_t>(kNumElements);
     allocated_size += sizeof(uint32_t) * kNumElements;
     EXPECT_LE(allocated_size, zone.SizeInBytes());
   }
@@ -109,7 +110,7 @@
     EXPECT(isolate->current_zone() != NULL);
 
     const intptr_t kNumElements = (kIntptrMax / sizeof(uint32_t)) + 1;
-    zone.Alloc<uint32_t>(kNumElements);
+    zone.GetZone()->Alloc<uint32_t>(kNumElements);
   }
   isolate->Shutdown();
   delete isolate;
@@ -165,7 +166,7 @@
 
 TEST_CASE(PrintToString) {
   StackZone zone(Isolate::Current());
-  const char* result = zone.PrintToString("Hello %s!", "World");
+  const char* result = zone.GetZone()->PrintToString("Hello %s!", "World");
   EXPECT_STREQ("Hello World!", result);
 }
 
diff --git a/tests/benchmark_smoke/benchmark_smoke.status b/tests/benchmark_smoke/benchmark_smoke.status
index b5c8682..5050ba7 100644
--- a/tests/benchmark_smoke/benchmark_smoke.status
+++ b/tests/benchmark_smoke/benchmark_smoke.status
@@ -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.
 
-[ $runtime == ie && ($system == linux || $system == macos) ]
+[ $runtime == ie9 && ($system == linux || $system == macos) ]
 *: Skip
 
 [ $runtime == safari && ($system == linux || $system == windows) ]
@@ -23,5 +23,5 @@
 [ $compiler == dart2js && $runtime == drt && $checked ]
 benchmark_smoke_test: Fail # TypeError: Object #<HTMLParagraphElement> has no method 'get$text'
 
-[ $runtime == ie && $compiler == dart2js && $checked ]
+[ $runtime == ie9 && $compiler == dart2js && $checked ]
 benchmark_smoke_test: Fail
diff --git a/tests/co19/co19-dart2dart.status b/tests/co19/co19-dart2dart.status
index 38b88e3..60f39e2 100644
--- a/tests/co19/co19-dart2dart.status
+++ b/tests/co19/co19-dart2dart.status
@@ -3,10 +3,31 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dart2dart ]
+# These tests need to be updated to the new Date core lib API, co19 issue 256:
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t01: Fail
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t02: Fail
+LibTest/core/Date/Date_A01_t04: Fail
+LibTest/core/Date/Date_A01_t05: Fail
+LibTest/core/Date/isUtc_A01_t01: Fail
+LibTest/core/Date/millisecondsSinceEpoch_A01_t01: Fail
+LibTest/core/Date/operator_GE_A01_t01: Fail
+LibTest/core/Date/operator_GT_A01_t01: Fail
+LibTest/core/Date/operator_LE_A01_t01: Fail
+LibTest/core/Date/operator_LT_A01_t01: Fail
+LibTest/core/Date/operator_equality_A01_t01: Fail
+LibTest/core/Date/timeZoneName_A01_t01: Fail
+LibTest/core/Date/timeZoneOffset_A01_t01: Fail
+LibTest/core/Date/toLocal_A01_t01: Fail
+LibTest/core/Date/toUtc_A01_t01: Fail
+
 LibTest/isolate/isolate_api/port_A01_t01: Skip # Times out.
 
+LibTest/core/OutOfMemoryException/OutOfMemoryException_A01_t01: Fail, OK # co19 issue 263
+LibTest/core/OutOfMemoryException/toString_A01_t01: Fail, OK # co19 issue 263
+
 Language/10_Expressions/11_Instance_Creation/1_New_A13_t02: Fail # TRIAGE
 
+Language/03_Overview/1_Scoping_A02_t05: Fail # inherited from dart2js
 Language/03_Overview/1_Scoping_A01_t39: Fail # http://dartbug.com/5519
 Language/03_Overview/1_Scoping_A01_t40: Fail # http://dartbug.com/5519
 Language/03_Overview/1_Scoping_A01_t41: Fail # http://dartbug.com/5519
@@ -176,6 +197,7 @@
 Language/07_Classes/6_Constructors_A02_t01: Fail # http://dartbug.com/5519
 Language/07_Classes/8_Static_Variables/1_Evaluation_of_Static_Variable_Getters_A01_t02: Fail # inherited from VM
 Language/07_Classes/8_Static_Variables/1_Evaluation_of_Static_Variable_Getters_A01_t05: Fail # inherited from VM
+Language/09_Generics/09_Generics_A05_t01: Fail # inherited from dart2js
 Language/09_Generics/09_Generics_A05_t02: Fail # inherited from VM
 Language/10_Expressions/01_Constants_A03_t02: Fail # http://dartbug.com/5519
 Language/10_Expressions/01_Constants_A03_t03: Fail # http://dartbug.com/5519
@@ -498,7 +520,6 @@
 Language/15_Reference/1_Lexical_Rules/1_Reserved_Words_A40_t04: Fail # inherited from dart2js
 Language/15_Reference/1_Lexical_Rules_A01_t06: Fail # inherited from VM
 Language/15_Reference/1_Lexical_Rules_A02_t06: Fail # inherited from dart2js
-LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A03_t01: Fail # inherited from VM
 LibTest/core/Date/Date.fromString_A03_t01: Fail, OK # Issue co19 - 121
 LibTest/core/Date/toString_A02_t01: Fail, OK # inherited from VM
 LibTest/core/Date/year_A01_t01: Fail, OK # inherited from VM
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index bcb41de..549830f 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -6,6 +6,7 @@
 # Crashes first, please. Then untriaged bugs. There is a section below
 # for co19 bugs.
 [ $compiler == dart2js ]
+Language/11_Statements/05_For_A01_t07: Crash
 Language/03_Overview/1_Scoping_A02_t06: Fail # TODO(ahe): Please triage this failure.
 Language/06_Functions/06_Functions_A01_t22: Fail # TODO(ahe): Please triage this failure.
 Language/07_Classes/07_Classes_A03_t01: Fail # TODO(ahe): Please triage this failure.
@@ -132,6 +133,8 @@
 # Partially implemented rediriecting constructors makes this fail.
 Language/07_Classes/6_Constructors/2_Factories_A01_t05: Fail
 
+LibTest/core/OutOfMemoryException/OutOfMemoryException_A01_t01: Fail, OK # co19 issue 263
+LibTest/core/OutOfMemoryException/toString_A01_t01: Fail, OK # co19 issue 263
 
 [ $compiler == dart2js && $unchecked ]
 Language/07_Classes/6_Constructors/2_Factories_A06_t05: Fail # TODO(ahe): Please triage this failure.
@@ -233,6 +236,25 @@
 LibTest/core/Set/remove_A01_t04: Fail, OK
 LibTest/core/Set/removeAll_A01_t03: Fail, OK
 
+# These tests need to be updated to the new Date core lib API, co19 issue 256:
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t01: Fail
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t02: Fail
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A02_t01: Fail # May be a different issue.
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A03_t01: Fail # May be a different issue.
+LibTest/core/Date/Date_A01_t04: Fail
+LibTest/core/Date/Date_A01_t05: Fail
+LibTest/core/Date/isUtc_A01_t01: Fail
+LibTest/core/Date/millisecondsSinceEpoch_A01_t01: Fail
+LibTest/core/Date/operator_GE_A01_t01: Fail
+LibTest/core/Date/operator_GT_A01_t01: Fail
+LibTest/core/Date/operator_LE_A01_t01: Fail
+LibTest/core/Date/operator_LT_A01_t01: Fail
+LibTest/core/Date/operator_equality_A01_t01: Fail
+LibTest/core/Date/timeZoneName_A01_t01: Fail
+LibTest/core/Date/timeZoneOffset_A01_t01: Fail
+LibTest/core/Date/toLocal_A01_t01: Fail
+LibTest/core/Date/toUtc_A01_t01: Fail
+
 [ $compiler == dart2js && $system == macos && $runtime == d8 ]
 LibTest/core/Math/acos_A01_t01: Fail, OK
 LibTest/core/Math/asin_A01_t01: Fail, OK
@@ -249,6 +271,8 @@
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t03: Fail # TODO(ahe): Enforce optional parameter semantics.
 Language/06_Functions/2_Formal_Parameters/2_Optional_Formals_A03_t04: Fail # TODO(ahe): Enforce optional parameter semantics.
 
+Language/09_Generics/09_Generics_A05_t01: Fail # dart2js fails to reject type variable within static member
+
 Language/10_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t01: Fail # Compile-time error: Unimplemented non-matching static call
 Language/10_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t04: Fail # Compile-time error: Unimplemented non-matching static call
 Language/10_Expressions/14_Function_Invocation/2_Binding_Actuals_to_Formals_A06_t05: Fail # Compile-time error: Unimplemented non-matching static call
@@ -323,9 +347,6 @@
 LibTest/core/RegExp/allMatches_A01_t01: Fail, OK # co19 issue 212
 LibTest/core/RegExp/Pattern_semantics/firstMatch_Term_A04_t01: Fail, OK # co19 issue 212
 
-[ $compiler == dart2js && $unchecked ]
-LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A03_t01: Fail
-
 [ $compiler == dart2js && $checked ]
 LibTest/core/Queue/addLast_A01_t01: Slow, Pass
 LibTest/core/Queue/add_A01_t01: Slow, Pass
@@ -411,6 +432,8 @@
 
 Language/13_Libraries_and_Scripts/2_Imports_A01_t39: Fail # co19 issue 253: Show combinators are intersections.
 
+Language/03_Overview/1_Scoping_A02_t05: Fail # co19 issue 261
+
 [ $compiler == dart2js && $runtime == d8 ]
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A04_t01: Fail, Pass # issue 3333
 LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A03_t01: Fail, Pass # issue 3333
@@ -728,7 +751,6 @@
 [ $compiler == dart2js ]
 Language/10_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t02: Fail # TypeError: Object #<C> has no method 'call$0'
 Language/10_Expressions/15_Method_Invocation/3_Static_Invocation_A04_t08: Fail # TypeError: Object #<Foo> has no method 'call$0'
-Language/10_Expressions/30_Type_Cast_A02_t01: Fail # Expect.identical(expected: <Instance of 'C'>, actual: <Instance of 'C'>) fails.
 Language/10_Expressions/30_Type_Cast_A02_t03: Fail # Expect.fail('CastError expected')
 Language/10_Expressions/30_Type_Cast_A05_t03: Fail # CastError: Casting value of type Number to incompatible type G
 Language/10_Expressions/30_Type_Cast_A05_t05: Fail # CastError: Casting value of type Number to incompatible type G
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 2b70819..97980a0 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -3,6 +3,26 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == none && $runtime == vm ]
+# These tests need to be updated to the new Date core lib API, co19 issue 256:
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t01: Fail
+LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A01_t02: Fail
+LibTest/core/Date/Date_A01_t04: Fail
+LibTest/core/Date/Date_A01_t05: Fail
+LibTest/core/Date/isUtc_A01_t01: Fail
+LibTest/core/Date/millisecondsSinceEpoch_A01_t01: Fail
+LibTest/core/Date/operator_GE_A01_t01: Fail
+LibTest/core/Date/operator_GT_A01_t01: Fail
+LibTest/core/Date/operator_LE_A01_t01: Fail
+LibTest/core/Date/operator_LT_A01_t01: Fail
+LibTest/core/Date/operator_equality_A01_t01: Fail
+LibTest/core/Date/timeZoneName_A01_t01: Fail
+LibTest/core/Date/timeZoneOffset_A01_t01: Fail
+LibTest/core/Date/toLocal_A01_t01: Fail
+LibTest/core/Date/toUtc_A01_t01: Fail
+
+LibTest/core/OutOfMemoryException/OutOfMemoryException_A01_t01: Fail # co19 issue 263
+LibTest/core/OutOfMemoryException/toString_A01_t01: Fail # co19 issue 263
+
 Language/13_Libraries_and_Scripts/2_Imports_A02_t21: Crash # TODO(vm-team): Please triage this crash.
 Language/13_Libraries_and_Scripts/2_Imports_A02_t22: Crash # TODO(vm-team): Please triage this crash.
 LibTest/isolate/isolate_api/port_A01_t01: Skip # Times out.
@@ -48,7 +68,6 @@
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A04_t03: Fail # TODO(vm-team): Please triage this failure.
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t01: Fail # TODO(vm-team): Please triage this failure.
 Language/07_Classes/6_Constructors/3_Constant_Constructors_A05_t02: Fail # TODO(vm-team): Please triage this failure.
-Language/07_Classes/6_Constructors_A01_t01: Fail # TODO(vm-team): Please triage this failure.
 Language/07_Classes/8_Static_Variables/1_Evaluation_of_Static_Variable_Getters_A01_t02: Fail # TODO(vm-team): Please triage this failure.
 Language/07_Classes/8_Static_Variables/1_Evaluation_of_Static_Variable_Getters_A01_t05: Fail # TODO(vm-team): Please triage this failure.
 Language/08_Interfaces/5_Superinterfaces_A01_t02: Fail # TODO(vm-team): Please triage this failure.
@@ -228,6 +247,8 @@
 # Failures related to assert being a reserved word now. co19 issue 218.
 Language/10_Expressions/28_Identifier_Reference_A04_t07: Fail, OK
 
+# negate is no longer a built-in identifier, co19 issue 260
+Language/10_Expressions/28_Identifier_Reference_A07_t09: Fail, OK # co19 issue 260
 
 [ $compiler == none && $runtime == vm && $checked ]
 Language/07_Classes/07_Classes_A03_t01: Fail # TODO(vm-team): Please triage this failure.
@@ -254,7 +275,6 @@
 Language/10_Expressions/30_Type_Cast_A05_t03: Fail # TODO(vm-team): Please triage this failure.
 Language/10_Expressions/30_Type_Cast_A05_t04: Fail # TODO(vm-team): Please triage this failure.
 Language/10_Expressions/30_Type_Cast_A05_t05: Fail # TODO(vm-team): Please triage this failure.
-LibTest/core/Date/Date.fromMillisecondsSinceEpoch_A03_t01: Fail # TODO(vm-team): Please triage this failure.
 
 
 [ $compiler == none && $runtime == vm ]
@@ -310,7 +330,6 @@
 Language/10_Expressions/14_Function_Invocation/4_Function_Expression_Invocation_A05_t01: Fail # issue 1604.
 Language/10_Expressions/21_Bitwise_Expressions_A01_t01: Fail # issue 1286 (function literals vs. function statements)
 Language/10_Expressions/22_Equality_A01_t01: Fail # issue 2033 (super call of !=, === etc)
-Language/10_Expressions/22_Equality_A05_t01: Fail # issue 2033 (super call of !=, === etc)
 Language/10_Expressions/21_Relational_Expressions_A01_t01: Fail # issue 1286 (function literals vs. function statements)
 Language/10_Expressions/22_Shift_A01_t01: Fail # issue 1286 (function literals vs. function statements)
 Language/10_Expressions/25_Unary_Expressions_A01_t01: Fail # issue 1288 (unary super operator call)
diff --git a/tests/compiler/dart2js/array_static_intercept_test.dart b/tests/compiler/dart2js/array_static_intercept_test.dart
index 6f7bf0a..815d92d 100644
--- a/tests/compiler/dart2js/array_static_intercept_test.dart
+++ b/tests/compiler/dart2js/array_static_intercept_test.dart
@@ -13,7 +13,7 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   Expect.isTrue(generated.contains(r'.add$1('));
   Expect.isTrue(generated.contains(r'.removeLast('));
   Expect.isTrue(generated.contains(r'.get$length('));
diff --git a/tests/compiler/dart2js/backend_htype_list_test.dart b/tests/compiler/dart2js/backend_htype_list_test.dart
index 3e860f0..5d56b84 100644
--- a/tests/compiler/dart2js/backend_htype_list_test.dart
+++ b/tests/compiler/dart2js/backend_htype_list_test.dart
@@ -2,17 +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.
 
-#import("dart:uri");
+import "dart:uri";
 
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/js_backend/js_backend.dart");
-#import("../../../lib/compiler/implementation/ssa/ssa.dart");
-#import("../../../lib/compiler/implementation/scanner/scannerlib.dart");
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/universe/universe.dart");
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/js_backend/js_backend.dart";
+import "../../../lib/compiler/implementation/ssa/ssa.dart";
+import "../../../lib/compiler/implementation/dart2jslib.dart";
 
-#import('compiler_helper.dart');
-#import('parser_helper.dart');
+import 'compiler_helper.dart';
+import 'parser_helper.dart';
 
 // Source names used throughout the tests.
 const SourceString x = const SourceString("x");
diff --git a/tests/compiler/dart2js/boolified_operator_test.dart b/tests/compiler/dart2js/boolified_operator_test.dart
index 66bdbd5..07ddbd2 100644
--- a/tests/compiler/dart2js/boolified_operator_test.dart
+++ b/tests/compiler/dart2js/boolified_operator_test.dart
@@ -49,27 +49,27 @@
 main() {
   RegExp regexp = const RegExp('=== true');
 
-  String generated = compile(TEST_EQUAL, 'foo');
+  String generated = compile(TEST_EQUAL, entry: 'foo');
   Expect.isFalse(generated.contains('=== true'));
   Expect.isTrue(generated.contains('eqB'));
 
-  generated = compile(TEST_EQUAL_NULL, 'foo');
+  generated = compile(TEST_EQUAL_NULL, entry: 'foo');
   Expect.isFalse(generated.contains('=== true'));
   Expect.isTrue(generated.contains('== null'));
 
-  generated = compile(TEST_LESS, 'foo');
+  generated = compile(TEST_LESS, entry: 'foo');
   Expect.isFalse(generated.contains('=== true'));
   Expect.isTrue(generated.contains('ltB'));
 
-  generated = compile(TEST_LESS_EQUAL, 'foo');
+  generated = compile(TEST_LESS_EQUAL, entry: 'foo');
   Expect.isFalse(generated.contains('=== true'));
   Expect.isTrue(generated.contains('leB'));
   
-  generated = compile(TEST_GREATER, 'foo');
+  generated = compile(TEST_GREATER, entry: 'foo');
   Expect.isFalse(generated.contains('=== true'));
   Expect.isTrue(generated.contains('gtB'));
   
-  generated = compile(TEST_GREATER_EQUAL, 'foo');
+  generated = compile(TEST_GREATER_EQUAL, entry: 'foo');
   Expect.isFalse(generated.contains('=== true'));
   Expect.isTrue(generated.contains('geB'));
 }
diff --git a/tests/compiler/dart2js/boolify_test.dart b/tests/compiler/dart2js/boolify_test.dart
index 6e01282..8e90efe 100644
--- a/tests/compiler/dart2js/boolify_test.dart
+++ b/tests/compiler/dart2js/boolify_test.dart
@@ -14,6 +14,6 @@
 """;
 
 main() {
-  String generated = compile(TEST, 'foo');
+  String generated = compile(TEST, entry: 'foo');
   Expect.isTrue(generated.contains('foo() !== true)'));
 }
diff --git a/tests/compiler/dart2js/builtin_equals_test.dart b/tests/compiler/dart2js/builtin_equals_test.dart
index 7664b6a..0456f7e 100644
--- a/tests/compiler/dart2js/builtin_equals_test.dart
+++ b/tests/compiler/dart2js/builtin_equals_test.dart
@@ -16,7 +16,7 @@
 """;
 
 main() {
-  String generated = compile(TEST, 'foo', enableTypeAssertions: true);
+  String generated = compile(TEST, entry: 'foo', enableTypeAssertions: true);
   Expect.isTrue(!generated.contains('eqB'));
 
   RegExp regexp = new RegExp('==');
diff --git a/tests/compiler/dart2js/builtin_interceptor_test.dart b/tests/compiler/dart2js/builtin_interceptor_test.dart
index b904a59..ae62bf4 100644
--- a/tests/compiler/dart2js/builtin_interceptor_test.dart
+++ b/tests/compiler/dart2js/builtin_interceptor_test.dart
@@ -34,15 +34,15 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   Expect.isTrue(generated.contains("return a.length;"));
 
-  generated = compile(TEST_TWO, 'foo');
+  generated = compile(TEST_TWO, entry: 'foo');
   Expect.isTrue(generated.contains("return 3;"));
 
-  generated = compile(TEST_THREE, 'foo');
+  generated = compile(TEST_THREE, entry: 'foo');
   Expect.isTrue(generated.contains("return 3;"));
 
-  generated = compile(TEST_FOUR, 'foo');
+  generated = compile(TEST_FOUR, entry: 'foo');
   Expect.isTrue(generated.contains("push(2);"));
 }
diff --git a/tests/compiler/dart2js/class_codegen_test.dart b/tests/compiler/dart2js/class_codegen_test.dart
index 09c45eb..6d751f0 100644
--- a/tests/compiler/dart2js/class_codegen_test.dart
+++ b/tests/compiler/dart2js/class_codegen_test.dart
@@ -53,8 +53,8 @@
 
 const String TEST_FIVE = r"""
 class A {
-  var x;
-  A(x) : this.x = x {}
+  var a;
+  A(a) : this.a = a {}
 }
 
 main() {
@@ -64,14 +64,14 @@
 
 twoClasses() {
   String generated = compileAll(TEST_ONE);
-  Expect.isTrue(generated.contains('\$.A = {"":\n [],\n "super": "Object"'));
-  Expect.isTrue(generated.contains('\$.B = {"":\n [],\n "super": "Object"'));
+  Expect.isTrue(generated.contains('\$.A = {"": [],\n "super": "Object"'));
+  Expect.isTrue(generated.contains('\$.B = {"": [],\n "super": "Object"'));
 }
 
 subClass() {
   checkOutput(String generated) {
-    Expect.isTrue(generated.contains('\$.A = {"":\n [],\n "super": "Object"'));
-    Expect.isTrue(generated.contains('\$.B = {"":\n [],\n "super": "A"'));
+    Expect.isTrue(generated.contains('\$.A = {"": [],\n "super": "Object"'));
+    Expect.isTrue(generated.contains('\$.B = {"": [],\n "super": "A"'));
   }
 
   checkOutput(compileAll(TEST_TWO));
@@ -80,17 +80,15 @@
 
 fieldTest() {
   String generated = compileAll(TEST_FOUR);
-  print(generated);
   Expect.isTrue(generated.contains(r"""
-$.B = {"":
- ["y", "z", "x"],
+$.B = {"": ["y", "z", "x"],
  "super": "A"
 }"""));
 }
 
 constructor1() {
   String generated = compileAll(TEST_FIVE);
-  Expect.isTrue(generated.contains(r"new $.A(x);"));
+  Expect.isTrue(generated.contains(r"new $.A(a);"));
 }
 
 main() {
diff --git a/tests/compiler/dart2js/code_motion_test.dart b/tests/compiler/dart2js/code_motion_test.dart
index 0c71c99..444de81 100644
--- a/tests/compiler/dart2js/code_motion_test.dart
+++ b/tests/compiler/dart2js/code_motion_test.dart
@@ -5,21 +5,21 @@
 #import("compiler_helper.dart");
 
 const String TEST_ONE = r"""
-foo(int param0, int param1, bool param2) {
+foo(int a, int b, bool param2) {
   for (int i = 0; i < 1; i++) {
-    var x = param0 + 5;  // '+' is now GVNed.
+    var x = a + 5;  // '+' is now GVNed.
     if (param2) {
-      print(param0 + param1);
+      print(a + b);
     } else {
-      print(param0 + param1);
+      print(a + b);
     }
   }
 }
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
-  RegExp regexp = const RegExp('param0 \\+ param1');
+  String generated = compile(TEST_ONE, entry: 'foo');
+  RegExp regexp = const RegExp('a \\+ b');
   Iterator matches = regexp.allMatches(generated).iterator();
   Expect.isTrue(matches.hasNext());
   matches.next();
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index 057a3aa..0caec0e 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -3,23 +3,23 @@
 // BSD-style license that can be found in the LICENSE file.
 // Test constant folding.
 
-#library("compiler_helper");
+library compiler_helper;
 
-#import("dart:uri");
+import "dart:uri";
 
-#import("../../../lib/compiler/implementation/elements/elements.dart", prefix: "lego");
-#import("../../../lib/compiler/implementation/js_backend/js_backend.dart", prefix: "js");
-#import("../../../lib/compiler/implementation/leg.dart", prefix: "leg");
-#import("../../../lib/compiler/implementation/ssa/ssa.dart", prefix: "ssa");
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import('../../../lib/compiler/implementation/source_file.dart');
+import "../../../lib/compiler/implementation/elements/elements.dart" as lego;
+import "../../../lib/compiler/implementation/js_backend/js_backend.dart" as js;
+import "../../../lib/compiler/implementation/dart2jslib.dart" as leg;
+import "../../../lib/compiler/implementation/ssa/ssa.dart" as ssa;
+import "../../../lib/compiler/implementation/util/util.dart";
+import '../../../lib/compiler/implementation/source_file.dart';
 
-#import("mock_compiler.dart");
-#import("parser_helper.dart");
+import "mock_compiler.dart";
+import "parser_helper.dart";
 
-String compile(String code, [String entry = 'main',
-                             bool enableTypeAssertions = false,
-                             bool minify = false]) {
+String compile(String code, {String entry: 'main',
+                             bool enableTypeAssertions: false,
+                             bool minify: false}) {
   MockCompiler compiler =
       new MockCompiler(enableTypeAssertions: enableTypeAssertions,
                        enableMinification: minify);
@@ -68,11 +68,11 @@
 String anyIdentifier = "[a-zA-Z][a-zA-Z0-9]*";
 
 String getIntTypeCheck(String variable) {
-  return "\\($variable !== \\($variable \\| 0\\)\\)";
+  return "\\($variable ?!== ?\\($variable ?\\| ?0\\)\\)";
 }
 
 String getNumberTypeCheck(String variable) {
-  return "\\(typeof $variable !== 'number'\\)";
+  return "\\(typeof $variable ?!== ?'number'\\)";
 }
 
 bool checkNumberOfMatches(Iterator it, int nb) {
@@ -84,15 +84,40 @@
 }
 
 void compileAndMatch(String code, String entry, RegExp regexp) {
-  String generated = compile(code, entry);
+  String generated = compile(code, entry: entry);
   Expect.isTrue(regexp.hasMatch(generated),
                 '"$generated" does not match /$regexp/');
 }
 
 void compileAndDoNotMatch(String code, String entry, RegExp regexp) {
-  String generated = compile(code, entry);
+  String generated = compile(code, entry: entry);
   Expect.isFalse(regexp.hasMatch(generated),
                  '"$generated" has a match in /$regexp/');
 }
 
 int length(Link link) => link.isEmpty() ? 0 : length(link.tail) + 1;
+
+// Does a compile and then a match where every 'x' is replaced by something
+// that matches any variable, and every space is optional.
+void compileAndMatchFuzzy(String code, String entry, String regexp) {
+  compileAndMatchFuzzyHelper(code, entry, regexp, true);
+}
+ 
+void compileAndDoNotMatchFuzzy(String code, String entry, String regexp) {
+  compileAndMatchFuzzyHelper(code, entry, regexp, false);
+}
+
+void compileAndMatchFuzzyHelper(
+    String code, String entry, String regexp, bool shouldMatch) {
+  String generated = compile(code, entry: entry);
+  final xRe = new RegExp('\\bx\\b');
+  regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
+  final spaceRe = new RegExp('\\s+');
+  regexp = regexp.replaceAll(spaceRe, '(?:\\s*)');
+  if (shouldMatch) {
+    Expect.isTrue(new RegExp(regexp).hasMatch(generated));
+  } else {
+    Expect.isFalse(new RegExp(regexp).hasMatch(generated));
+  }
+}
+
diff --git a/tests/compiler/dart2js/compiler_test.dart b/tests/compiler/dart2js/compiler_test.dart
index 9a525e2..6015342 100644
--- a/tests/compiler/dart2js/compiler_test.dart
+++ b/tests/compiler/dart2js/compiler_test.dart
@@ -2,12 +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.
 
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import("mock_compiler.dart");
-#import("parser_helper.dart");
+import "../../../lib/compiler/implementation/dart2jslib.dart";
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/resolution/resolution.dart";
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import "../../../lib/compiler/implementation/util/util.dart";
+import "mock_compiler.dart";
+import "parser_helper.dart";
 
 class CallbackMockCompiler extends MockCompiler {
   CallbackMockCompiler();
diff --git a/tests/compiler/dart2js/constant_folding_test.dart b/tests/compiler/dart2js/constant_folding_test.dart
index 4f9a8ef..24b7630 100644
--- a/tests/compiler/dart2js/constant_folding_test.dart
+++ b/tests/compiler/dart2js/constant_folding_test.dart
@@ -36,7 +36,7 @@
   compileAndMatch(
       NEGATIVE_NUMBER_FOLDING, 'main', const RegExp(r"print\(1\)"));
 
-  String generated = compile(NULL_EQUALS_FOLDING, 'foo');
+  String generated = compile(NULL_EQUALS_FOLDING, entry: 'foo');
   RegExp regexp = const RegExp(r'a == null');
   Expect.isTrue(regexp.hasMatch(generated));
 
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index d1b1e73..db593b9 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -1,14 +1,18 @@
-#import("dart:uri");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
-#import('../../../lib/compiler/implementation/source_file.dart');
-#import('../../../lib/compiler/implementation/types/types.dart');
-#import('../../../lib/compiler/implementation/tree/tree.dart');
-#import("../../../lib/compiler/implementation/leg.dart", prefix: "leg");
+// Copyright (c) 2012, 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("parser_helper.dart");
-#import("compiler_helper.dart");
-#import("mock_compiler.dart");
+import "dart:uri";
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import '../../../lib/compiler/implementation/scanner/scannerlib.dart';
+import '../../../lib/compiler/implementation/source_file.dart';
+import '../../../lib/compiler/implementation/types/types.dart';
+import '../../../lib/compiler/implementation/tree/tree.dart';
+import "../../../lib/compiler/implementation/dart2jslib.dart" as leg;
+
+import "parser_helper.dart";
+import "compiler_helper.dart";
+import "mock_compiler.dart";
 
 /**
  * Finds the node corresponding to the last occurence of the substring
@@ -43,14 +47,19 @@
   BaseType double;
   BaseType bool;
   BaseType string;
+  BaseType list;
+  BaseType map;
+  BaseType nullType;
 
-  AnalysisResult(MockCompiler compiler, ConcreteTypesInferrer inferrer)
-      : this.compiler = compiler,
-        this.inferrer = inferrer,
-        int = inferrer.baseTypes.intBaseType,
-        double = inferrer.baseTypes.doubleBaseType,
-        bool = inferrer.baseTypes.boolBaseType,
-        string = inferrer.baseTypes.stringBaseType {
+  AnalysisResult(MockCompiler compiler) : this.compiler = compiler {
+    inferrer = compiler.typesTask.concreteTypesInferrer;
+    int = inferrer.baseTypes.intBaseType;
+    double = inferrer.baseTypes.doubleBaseType;
+    bool = inferrer.baseTypes.boolBaseType;
+    string = inferrer.baseTypes.stringBaseType;
+    list = inferrer.baseTypes.listBaseType;
+    map = inferrer.baseTypes.mapBaseType;
+    nullType = new NullBaseType();
     Element mainElement = compiler.mainApp.find(buildSourceString('main'));
     ast = mainElement.parseNode(compiler);
   }
@@ -113,12 +122,10 @@
 
 AnalysisResult analyze(String code) {
   Uri uri = new Uri.fromComponents(scheme: 'source');
-  MockCompiler compiler = new MockCompiler();
+  MockCompiler compiler = new MockCompiler(enableConcreteTypeInference: true);
   compiler.sourceFiles[uri.toString()] = new SourceFile(uri.toString(), code);
   compiler.runCompiler(uri);
-  ConcreteTypesInferrer inferrer = new ConcreteTypesInferrer(compiler);
-  inferrer.analyzeMain(compiler.mainApp.find(const SourceString("main")));
-  return new AnalysisResult(compiler, inferrer);
+  return new AnalysisResult(compiler);
 }
 
 testLiterals() {
@@ -287,7 +294,7 @@
   final String source = r"""
       class A {
         var x, y, z, w;
-        A(this.x, [this.y, this.z, this.w]);
+        A(this.x, {this.y, this.z, this.w});
       }
       main() {
         new A(42);
@@ -301,6 +308,72 @@
   result.checkFieldHasType('A', 'w', [new NullBaseType(), result.bool]);
 }
 
+testListLiterals() {
+  final String source = r"""
+      class A {
+        var x;
+        A(this.x);
+      }
+      main() {
+        var x = [];
+        var y = [1, "a", null, new A(42)];
+        x; y;
+      }
+      """;
+  AnalysisResult result = analyze(source);
+  result.checkNodeHasType('x', [result.list]);
+  result.checkNodeHasType('y', [result.list]);
+  result.checkFieldHasType('A', 'x', [result.int]);
+}
+
+testMapLiterals() {
+  final String source = r"""
+      class A {
+        var x;
+        A(this.x);
+      }
+      main() {
+        var x = {};
+        var y = {'a': "foo", 'b': new A(42) };
+        x; y;
+      }
+      """;
+  AnalysisResult result = analyze(source);
+  result.checkNodeHasType('x', [result.map]);
+  result.checkNodeHasType('y', [result.map]);
+  result.checkFieldHasType('A', 'x', [result.int]);
+}
+
+testReturn() {
+  final String source = r"""
+      f() { if (true) { return 1; }; return "a"; }
+      g() { f(); return; }
+      main() {
+        var x = f();
+        var y = g();
+        x; y;
+      }
+      """;
+  AnalysisResult result = analyze(source);
+  result.checkNodeHasType('x', [result.int, result.string]);
+  result.checkNodeHasType('y', [result.nullType]);
+}
+
+testNoReturn() {
+  final String source = r"""
+      f() { if (true) { return 1; }; }
+      g() { f(); }
+      main() {
+        var x = f();
+        var y = g();
+        x; y;
+      }
+      """;
+  AnalysisResult result = analyze(source);
+  result.checkNodeHasType('x', [result.int, result.nullType]);
+  result.checkNodeHasType('y', [result.nullType]);
+}
+
 void main() {
   testLiterals();
   testRedefinition();
@@ -314,4 +387,8 @@
   testGetters();
   testSetters();
   testNamedParameters();
+  testListLiterals();
+  testMapLiterals();
+  testReturn();
+  // testNoReturn(); // right now we infer the empty type instead of null
 }
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index 0478963..3c959f8 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -10,5 +10,5 @@
 # Minification of locals temporarily disabled due to issue 5808
 minify_many_locals_test: Fail
 
-[ $runtime == d8 || $runtime == drt || $runtime == dartium || $runtime == ff || $runtime == firefox || $runtime == chrome || $runtime == safari || $runtime == ie || $runtime == opera ]
+[ $runtime == d8 || $runtime == drt || $runtime == dartium || $runtime == ff || $runtime == firefox || $runtime == chrome || $runtime == safari || $runtime == ie9 || $runtime == opera ]
 *: Skip # dart2js uses #import('dart:io'); and it is not self-hosted (yet).
diff --git a/tests/compiler/dart2js/dart_backend_test.dart b/tests/compiler/dart2js/dart_backend_test.dart
index 3e7582d..761f7f9 100644
--- a/tests/compiler/dart2js/dart_backend_test.dart
+++ b/tests/compiler/dart2js/dart_backend_test.dart
@@ -2,14 +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.
 
-#import('dart:uri');
-#import('parser_helper.dart');
-#import('mock_compiler.dart');
-#import("../../../lib/compiler/compiler.dart");
-#import("../../../lib/compiler/implementation/leg.dart", prefix:'leg');
-#import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
+import 'dart:uri';
+import 'parser_helper.dart';
+import 'mock_compiler.dart';
+import '../../../lib/compiler/compiler.dart';
+import '../../../lib/compiler/implementation/dart2jslib.dart' as leg;
+import '../../../lib/compiler/implementation/dart_backend/dart_backend.dart';
+import '../../../lib/compiler/implementation/elements/elements.dart';
+import '../../../lib/compiler/implementation/tree/tree.dart';
 
 const coreLib = r'''
 #library('corelib');
@@ -54,13 +54,14 @@
 #library('js_helper');
 ''';
 
-testDart2Dart(String src, [void continuation(String s), bool minify = false,
-    bool stripTypes = false]) {
+testDart2Dart(String src, {void continuation(String s), bool minify: false,
+    bool stripTypes: false}) {
   // If continuation is not provided, check that source string remains the same.
   if (continuation === null) {
     continuation = (s) { Expect.equals(src, s); };
   }
-  testDart2DartWithLibrary(src, '', continuation, minify, stripTypes);
+  testDart2DartWithLibrary(src, '', continuation: continuation, minify: minify,
+      stripTypes: stripTypes);
 }
 
 /**
@@ -68,8 +69,8 @@
  */
 testDart2DartWithLibrary(
     String srcMain, String srcLibrary,
-    [void continuation(String s), bool minify = false,
-    bool stripTypes = false]) {
+    {void continuation(String s), bool minify: false,
+    bool stripTypes: false}) {
   fileUri(path) => new Uri.fromComponents(scheme: 'file', path: path);
 
   final scriptUri = fileUri('script.dart');
@@ -119,7 +120,7 @@
   should_be_kept();
 }
 ''';
-  testDart2Dart(src, (String s) {
+  testDart2Dart(src, continuation: (String s) {
     Expect.equals('should_be_kept(){}main(){should_be_kept();}', s);
   });
 }
@@ -260,7 +261,7 @@
          'A.field;A.staticfoo();'
          'new A();new A.fromFoo();new A().foo();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testNoConflictSendsRename() {
@@ -319,7 +320,7 @@
           'new MyA.myfromFoo();new MyA().myfoo();globalfoo();A.field;'
           'A.staticfoo();new A();new A.fromFoo();new A().foo();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testConflictLibraryClassRename() {
@@ -368,7 +369,7 @@
     'main(){var a=new A();a.foo();var b=new p_A.fromFoo();b.foo();'
         'var GREATVAR=b.myliba;b.mylist;a=getA();p_topfoo();topfoo();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testDefaultClassWithArgs() {
@@ -415,7 +416,7 @@
     'set p_topgetset(arg){}'
     'main(){p_topgetset;p_topgetset=6;topgetset;topgetset=5;}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testFieldTypeOutput() {
@@ -514,7 +515,7 @@
     'class p_B{factory p_I(){}}'
     'main(){new p_I();new p_A();new I();new A();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testTypeVariablesAreRenamed() {
@@ -558,7 +559,7 @@
     'main(){p_MyFunction myf1;MyFunction myf2;new p_A<int>().f;'
         'new p_T();new A<int>().f;new T();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testClassTypeArgumentBound() {
@@ -587,7 +588,7 @@
     'class p_A<p_T extends p_I>{}'
     'main(){new p_A();new A();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testDoubleMains() {
@@ -605,7 +606,7 @@
     'p_main(){}'
     'main(){p_main();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testInterfaceDefaultAnotherLib() {
@@ -631,7 +632,7 @@
     'interface I<T> default C<T>{I();}'
     'main(){new I();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testStaticAccessIoLib() {
@@ -645,7 +646,7 @@
   var expectedResult = 'import "dart:io" as p;'
       'main(){p.Platform.operatingSystem;}';
   testDart2Dart(src,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testMinification() {
@@ -658,7 +659,7 @@
   var expectedResult =
       'class A{}'
       'main(){new A();}';
-  testDart2Dart(src,
+  testDart2Dart(src, continuation:
       (String result) { Expect.equals(expectedResult, result); }, minify: true);
 }
 
@@ -677,7 +678,7 @@
 ''';
   var expectedResult =
       'main(){var A=7; B(A,C){ D(E,F){var G=A;}D(C,A);}B(A,8);}';
-  testDart2Dart(src,
+  testDart2Dart(src, continuation:
       (String result) { Expect.equals(expectedResult, result); }, minify: true);
 }
 
@@ -704,7 +705,7 @@
   var expectedResult =
       'class B{var E;static C(A){A=5;}}D(A,[optionalarg=7]){A=6;}'
       'main(){new B().E;B.C(8);D(8);}';
-  testDart2Dart(src,
+  testDart2Dart(src, continuation:
       (String result) { Expect.equals(expectedResult, result); }, minify: true);
 }
 
@@ -738,7 +739,7 @@
     'class LinkFactory<T>{factory Link(){}}'
     'main(){new Link<int>();}';
   testDart2DartWithLibrary(mainSrc, librarySrc,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 testDeclarationTypePlaceholders() {
@@ -756,7 +757,7 @@
   var expectedResult =
       ' foo( arg){}main(){var localvar;foo("5");}';
   testDart2Dart(src,
-      (String result) { Expect.equals(expectedResult, result); },
+      continuation: (String result) { Expect.equals(expectedResult, result); },
       stripTypes: true);
 }
 
@@ -776,7 +777,7 @@
       'class A{static String get userAgent=>p.window.navigator.userAgent;}'
       'main(){A.userAgent;}';
   testDart2Dart(src,
-      (String result) { Expect.equals(expectedResult, result); });
+      continuation: (String result) { Expect.equals(expectedResult, result); });
 }
 
 main() {
diff --git a/tests/compiler/dart2js/dead_phi_eliminator_test.dart b/tests/compiler/dart2js/dead_phi_eliminator_test.dart
index 3cbc503..5e2114a 100644
--- a/tests/compiler/dart2js/dead_phi_eliminator_test.dart
+++ b/tests/compiler/dart2js/dead_phi_eliminator_test.dart
@@ -16,7 +16,7 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   RegExp regexp = const RegExp("toBeRemoved");
   Expect.isTrue(!regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/gvn_test.dart b/tests/compiler/dart2js/gvn_test.dart
index c63b2c6..664ac2b 100644
--- a/tests/compiler/dart2js/gvn_test.dart
+++ b/tests/compiler/dart2js/gvn_test.dart
@@ -14,8 +14,8 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
-  RegExp regexp = const RegExp(r"1 \+ bar");
+  String generated = compile(TEST_ONE, entry: 'foo');
+  RegExp regexp = const RegExp(r"1 \+ [a-z]+");
   Iterator matches = regexp.allMatches(generated).iterator();
   Expect.isTrue(matches.hasNext());
   matches.next();
diff --git a/tests/compiler/dart2js/identity_test.dart b/tests/compiler/dart2js/identity_test.dart
index f4c523a..40d6a05 100644
--- a/tests/compiler/dart2js/identity_test.dart
+++ b/tests/compiler/dart2js/identity_test.dart
@@ -14,7 +14,7 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
 
   // Check that no boolify code is generated.
   RegExp regexp = const RegExp("=== true");
diff --git a/tests/compiler/dart2js/inverse_operator_test.dart b/tests/compiler/dart2js/inverse_operator_test.dart
index df3da80..2b48242 100644
--- a/tests/compiler/dart2js/inverse_operator_test.dart
+++ b/tests/compiler/dart2js/inverse_operator_test.dart
@@ -16,6 +16,5 @@
 
 main() {
   // Make sure we don't introduce a new variable.
-  RegExp regexp = new RegExp("1 >= x");
-  compileAndMatch(MAIN, 'main', regexp);
+  compileAndMatchFuzzy(MAIN, 'main', "1 >= x");
 }
diff --git a/tests/compiler/dart2js/is_inference2_test.dart b/tests/compiler/dart2js/is_inference2_test.dart
index c48e4a2..00016a9 100644
--- a/tests/compiler/dart2js/is_inference2_test.dart
+++ b/tests/compiler/dart2js/is_inference2_test.dart
@@ -12,7 +12,7 @@
 """;
 
 main() {
-  String generated = compile(TEST_IF_BOOL_FIRST_INSTRUCTION, 'negate');
+  String generated = compile(TEST_IF_BOOL_FIRST_INSTRUCTION, entry: 'negate');
   Expect.isTrue(generated.contains("!"));  // We want to see !x.
   Expect.isFalse(generated.contains("!="));  // And not !== true.
   Expect.isFalse(generated.contains("true"));
diff --git a/tests/compiler/dart2js/is_inference_test.dart b/tests/compiler/dart2js/is_inference_test.dart
index ae958ea..7ac6f02 100644
--- a/tests/compiler/dart2js/is_inference_test.dart
+++ b/tests/compiler/dart2js/is_inference_test.dart
@@ -63,7 +63,7 @@
 """;
 
 compileAndTest(String code) {
-  String generated = compile(code, 'test');
+  String generated = compile(code, entry: 'test');
   RegExp validAdd =
       new RegExp("($anyIdentifier \\+ 42)|($anyIdentifier \\+= 42)");
   RegExp invalidAdd = new RegExp("$anyIdentifier \\+ 53");
diff --git a/tests/compiler/dart2js/literal_list_test.dart b/tests/compiler/dart2js/literal_list_test.dart
index c1bdb3e..08b72d0 100644
--- a/tests/compiler/dart2js/literal_list_test.dart
+++ b/tests/compiler/dart2js/literal_list_test.dart
@@ -14,7 +14,7 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   Expect.isTrue(generated.contains('print([1, 2]);'));
   Expect.isTrue(generated.contains('print([3]);'));
   Expect.isTrue(generated.contains('print([4, 5]);'));
diff --git a/tests/compiler/dart2js/loop_test.dart b/tests/compiler/dart2js/loop_test.dart
index 5de0176..ed5db3a 100644
--- a/tests/compiler/dart2js/loop_test.dart
+++ b/tests/compiler/dart2js/loop_test.dart
@@ -74,16 +74,16 @@
 
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   Expect.isTrue(generated.contains(r'for ('));
-  generated = compile(TEST_TWO, 'foo');
+  generated = compile(TEST_TWO, entry: 'foo');
   Expect.isTrue(!generated.contains(r'break'));
-  generated = compile(TEST_THREE, 'foo');
+  generated = compile(TEST_THREE, entry: 'foo');
   Expect.isTrue(!generated.contains(r'break'));
-  generated = compile(TEST_FOUR, 'foo');
+  generated = compile(TEST_FOUR, entry: 'foo');
   Expect.isTrue(generated.contains(r'continue'));
-  generated = compile(TEST_FIVE, 'foo');
+  generated = compile(TEST_FIVE, entry: 'foo');
   Expect.isTrue(generated.contains(r'continue'));
-  generated = compile(TEST_SIX, 'foo');
+  generated = compile(TEST_SIX, entry: 'foo');
   Expect.isTrue(generated.contains(r'continue'));
 }
diff --git a/tests/compiler/dart2js/metadata_test.dart b/tests/compiler/dart2js/metadata_test.dart
index 4e02d54..11d0bd5 100644
--- a/tests/compiler/dart2js/metadata_test.dart
+++ b/tests/compiler/dart2js/metadata_test.dart
@@ -2,16 +2,16 @@
 // 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:uri");
+import "dart:uri";
 
-#import('compiler_helper.dart');
-#import('parser_helper.dart');
+import 'compiler_helper.dart';
+import 'parser_helper.dart';
 
-#import('../../../lib/compiler/implementation/elements/elements.dart');
-#import('../../../lib/compiler/implementation/leg.dart');
+import '../../../lib/compiler/implementation/elements/elements.dart';
+import '../../../lib/compiler/implementation/dart2jslib.dart';
 
 void checkAnnotation(String name, String declaration,
-                     [bool isTopLevelOnly = false]) {
+                     {bool isTopLevelOnly: false}) {
   var source;
 
   // Ensure that a compile-time constant can be resolved from an
diff --git a/tests/compiler/dart2js/mirrors_helper.dart b/tests/compiler/dart2js/mirrors_helper.dart
index e9a0f9d..7d33002 100644
--- a/tests/compiler/dart2js/mirrors_helper.dart
+++ b/tests/compiler/dart2js/mirrors_helper.dart
@@ -46,3 +46,11 @@
   }
 }
 
+class _PrivateClass {
+  var _privateField;
+  get _privateGetter => _privateField;
+  void set _privateSetter(value) => _privateField = value;
+  void _privateMethod() {}
+  _PrivateClass._privateConstructor();
+  factory _PrivateClass._privateFactoryConstructor() => new _PrivateClass();
+}
\ No newline at end of file
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 610438c..5e6d398 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -66,6 +66,7 @@
   // TODO(johnniwinther): Add tests of type argument substitution, which
   // is not currently implemented in dart2js.
   // TODO(johnniwinther): Add tests of Location and Source.
+  testPrivate(mirrors, helperLibrary, types);
 }
 
 // Testing class Foo:
@@ -74,7 +75,7 @@
 //
 // }
 void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
-             Map<Object,TypeMirror> types) {
+             Map<String,TypeMirror> types) {
   var fooClass = types["Foo"];
   Expect.isNotNull(fooClass, "Type 'Foo' not found");
   Expect.isTrue(fooClass is InterfaceMirror,
@@ -147,7 +148,7 @@
 //
 // }
 void testBar(MirrorSystem system, LibraryMirror helperLibrary,
-             Map<Object,TypeMirror> types) {
+             Map<String,TypeMirror> types) {
   var barInterface = types["Bar"];
   Expect.isNotNull(barInterface, "Type 'Bar' not found");
   Expect.isTrue(barInterface is InterfaceMirror,
@@ -237,7 +238,7 @@
 //   int operator -() => 0;
 // }
 void testBaz(MirrorSystem system, LibraryMirror helperLibrary,
-             Map<Object,TypeMirror> types) {
+             Map<String,TypeMirror> types) {
   var bazClass = types["Baz"];
   Expect.isNotNull(bazClass, "Type 'Baz' not found");
   Expect.isTrue(bazClass is InterfaceMirror,
@@ -685,3 +686,56 @@
   // TODO(johnniwinther): Add more tests of constructors.
   // TODO(johnniwinther): Add a test for unnamed factory methods.
 }
+
+// class _PrivateClass {
+//   var _privateField;
+//   get _privateGetter => _privateField;
+//   void set _privateSetter(value) => _privateField = value;
+//   void _privateMethod() {}
+//   _PrivateClass._privateConstructor();
+//   factory _PrivateClass._privateFactoryConstructor() => new _PrivateClass();
+// }
+void testPrivate(MirrorSystem system, LibraryMirror helperLibrary,
+                 Map<String,TypeMirror> types) {
+  var privateClass = types['_PrivateClass'];
+  Expect.isNotNull(privateClass);
+  Expect.isTrue(privateClass is InterfaceMirror);
+  Expect.isTrue(privateClass.isClass);
+  Expect.isTrue(privateClass.isPrivate);
+
+  var privateField = privateClass.declaredMembers['_privateField'];
+  Expect.isNotNull(privateField);
+  Expect.isTrue(privateField is FieldMirror);
+  Expect.isTrue(privateField.isPrivate);
+
+  var privateGetter = privateClass.declaredMembers['_privateGetter'];
+  Expect.isNotNull(privateGetter);
+  Expect.isTrue(privateGetter is MethodMirror);
+  Expect.isTrue(privateGetter.isGetter);
+  Expect.isTrue(privateGetter.isPrivate);
+
+  var privateSetter = privateClass.declaredMembers['_privateSetter='];
+  Expect.isNotNull(privateSetter);
+  Expect.isTrue(privateSetter is MethodMirror);
+  Expect.isTrue(privateSetter.isSetter);
+  Expect.isTrue(privateSetter.isPrivate);
+
+  var privateMethod = privateClass.declaredMembers['_privateMethod'];
+  Expect.isNotNull(privateMethod);
+  Expect.isTrue(privateMethod is MethodMirror);
+  Expect.isTrue(privateMethod.isPrivate);
+
+  var privateConstructor =
+      privateClass.declaredMembers['_PrivateClass._privateConstructor'];
+  Expect.isNotNull(privateConstructor);
+  Expect.isTrue(privateConstructor is MethodMirror);
+  Expect.isTrue(privateConstructor.isConstructor);
+  Expect.isTrue(privateConstructor.isPrivate);
+
+  var privateFactoryConstructor =
+      privateClass.declaredMembers['_PrivateClass._privateFactoryConstructor'];
+  Expect.isNotNull(privateFactoryConstructor);
+  Expect.isTrue(privateFactoryConstructor is MethodMirror);
+  Expect.isTrue(privateFactoryConstructor.isFactory);
+  Expect.isTrue(privateFactoryConstructor.isPrivate);
+}
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 6c37746..d2efbe0 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -2,17 +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.
 
-#library('mock_compiler');
+library mock_compiler;
 
-#import("dart:uri");
+import 'dart:uri';
 
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/leg.dart");
-#import('../../../lib/compiler/implementation/source_file.dart');
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import('../../../lib/compiler/compiler.dart', prefix: 'api');
-#import("parser_helper.dart");
+import '../../../lib/compiler/compiler.dart' as api;
+import '../../../lib/compiler/implementation/dart2jslib.dart' hide TreeElementMapping;
+import '../../../lib/compiler/implementation/elements/elements.dart';
+import '../../../lib/compiler/implementation/resolution/resolution.dart';
+import '../../../lib/compiler/implementation/source_file.dart';
+import '../../../lib/compiler/implementation/tree/tree.dart';
+import '../../../lib/compiler/implementation/util/util.dart';
+import 'parser_helper.dart';
 
 class WarningMessage {
   Node node;
@@ -35,6 +36,7 @@
   guard$stringOrArray(x) { return x; }
   index(a, index) {}
   indexSet(a, index, value) {}
+  makeLiteralMap(List keyValuePairs) {}
   setRuntimeTypeInfo(a, b) {}
   getRuntimeTypeInfo(a) {}
   stringTypeCheck(x) {}
@@ -63,6 +65,7 @@
   class Function {}
   interface List default ListImplementation { List([length]);}
   class ListImplementation { factory List([length]) => null; }
+  abstract class Map {}
   class Closure {}
   class Null {}
   class Dynamic_ {}
@@ -74,15 +77,17 @@
   final Map<String, SourceFile> sourceFiles;
   Node parsedTree;
 
-  MockCompiler([String coreSource = DEFAULT_CORELIB,
-                String helperSource = DEFAULT_HELPERLIB,
-                String interceptorsSource = DEFAULT_INTERCEPTORSLIB,
-                bool enableTypeAssertions = false,
-                bool enableMinification = false])
+  MockCompiler({String coreSource: DEFAULT_CORELIB,
+                String helperSource: DEFAULT_HELPERLIB,
+                String interceptorsSource: DEFAULT_INTERCEPTORSLIB,
+                bool enableTypeAssertions: false,
+                bool enableMinification: false,
+                bool enableConcreteTypeInference: false})
       : warnings = [], errors = [],
         sourceFiles = new Map<String, SourceFile>(),
         super(enableTypeAssertions: enableTypeAssertions,
-              enableMinification: enableMinification) {
+              enableMinification: enableMinification,
+              enableConcreteTypeInference: enableConcreteTypeInference) {
     coreLibrary = createLibrary("core", coreSource);
     // We need to set the assert method to avoid calls with a 'null'
     // target being interpreted as a call to assert.
diff --git a/tests/compiler/dart2js/no_constructor_body_test.dart b/tests/compiler/dart2js/no_constructor_body_test.dart
index 52ce77c..3588e0d 100644
--- a/tests/compiler/dart2js/no_constructor_body_test.dart
+++ b/tests/compiler/dart2js/no_constructor_body_test.dart
@@ -18,5 +18,5 @@
 main() {
   String generated = compileAll(TEST);
   Expect.isTrue(
-      generated.contains('\$.A = {"":\n [],\n "super": "Object"\n};'));
+      generated.contains('\$.A = {"": [],\n "super": "Object"\n}'));
 }
diff --git a/tests/compiler/dart2js/no_duplicate_stub_test.dart b/tests/compiler/dart2js/no_duplicate_stub_test.dart
index c8e239b..5777470 100644
--- a/tests/compiler/dart2js/no_duplicate_stub_test.dart
+++ b/tests/compiler/dart2js/no_duplicate_stub_test.dart
@@ -6,7 +6,7 @@
 
 const String TEST = r"""
 class A {
-  foo([a, b]) {}
+  foo({a, b}) {}
 }
 
 class B extends A {
diff --git a/tests/compiler/dart2js/null_type_test.dart b/tests/compiler/dart2js/null_type_test.dart
index fb01630..ba9f596 100644
--- a/tests/compiler/dart2js/null_type_test.dart
+++ b/tests/compiler/dart2js/null_type_test.dart
@@ -12,6 +12,6 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   Expect.isFalse(generated.contains('typeof (void 0)'));
 }
diff --git a/tests/compiler/dart2js/parameter_phi_elimination_test.dart b/tests/compiler/dart2js/parameter_phi_elimination_test.dart
index 503333f..2fbb34b 100644
--- a/tests/compiler/dart2js/parameter_phi_elimination_test.dart
+++ b/tests/compiler/dart2js/parameter_phi_elimination_test.dart
@@ -19,5 +19,5 @@
 
 
 main() {
-  compile(SOURCE, "baz");
+  compile(SOURCE, entry: "baz");
 }
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart
index 523e1f5..99c8733 100644
--- a/tests/compiler/dart2js/parser_helper.dart
+++ b/tests/compiler/dart2js/parser_helper.dart
@@ -2,19 +2,19 @@
 // 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('parser_helper');
+library parser_helper;
 
-#import("dart:uri");
+import "dart:uri";
 
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/source_file.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import '../../../lib/compiler/implementation/scanner/scannerlib.dart';
+import "../../../lib/compiler/implementation/dart2jslib.dart" hide SourceString;
+import "../../../lib/compiler/implementation/source_file.dart";
+import "../../../lib/compiler/implementation/util/util.dart";
 
 class LoggerCanceler implements DiagnosticListener {
-  void cancel([String reason, node, token, instruction, element]) {
+  void cancel(String reason, {node, token, instruction, element}) {
     throw new CompilerCancelledException(reason);
   }
 
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index 1e294c1..c7f3c8c 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -2,13 +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.
 
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import("mock_compiler.dart");
-#import("parser_helper.dart");
-#import("dart:uri");
+import "../../../lib/compiler/implementation/dart2jslib.dart";
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import "../../../lib/compiler/implementation/util/util.dart";
+import "mock_compiler.dart";
+import "parser_helper.dart";
+import "dart:uri";
 
 Compiler applyPatch(String script, String patch) {
   String core = "$DEFAULT_CORELIB\n$script";
@@ -44,11 +44,11 @@
 Element ensure(compiler,
                String name,
                Element lookup(name),
-               [bool isPatched = false,
-                bool isPatch = false,
-                bool isMethod = true,
-                bool isGetter = false,
-                bool isFound = true]) {
+               {bool isPatched: false,
+                bool isPatch: false,
+                bool isMethod: true,
+                bool isGetter: false,
+                bool isFound: true}) {
   var element = lookup(buildSourceString(name));
   if (!isFound) {
     Expect.isNull(element);
diff --git a/tests/compiler/dart2js/pretty_parameter_test.dart b/tests/compiler/dart2js/pretty_parameter_test.dart
index 54da483..7d44d3e 100644
--- a/tests/compiler/dart2js/pretty_parameter_test.dart
+++ b/tests/compiler/dart2js/pretty_parameter_test.dart
@@ -68,23 +68,23 @@
 """;
 
 main() {
-  String generated = compile(FOO, 'foo');
+  String generated = compile(FOO, entry: 'foo');
   // TODO(ngeoffray): Use 'contains' when frog supports it.
   RegExp regexp = const RegExp(r"function\(a, b\) {");
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(BAR, 'bar');
+  generated = compile(BAR, entry: 'bar');
   regexp = const RegExp(r"function\(eval\$, \$\$eval\) {");
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(PARAMETER_AND_TEMP, 'bar');
+  generated = compile(PARAMETER_AND_TEMP, entry: 'bar');
   regexp = const RegExp(r"print\(t0\)");
   Expect.isTrue(regexp.hasMatch(generated));
   // Check that the second 't0' got another name.
   regexp = const RegExp(r"print\(t0_0\)");
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(NO_LOCAL, 'foo');
+  generated = compile(NO_LOCAL, entry: 'foo');
   regexp = const RegExp("return baz");
   Expect.isTrue(regexp.hasMatch(generated));
   regexp = const RegExp(r"baz = 2");
@@ -94,7 +94,7 @@
   regexp = const RegExp("bar === true");
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(MULTIPLE_PHIS_ONE_LOCAL, 'foo');
+  generated = compile(MULTIPLE_PHIS_ONE_LOCAL, entry: 'foo');
   regexp = const RegExp(r"var a = 2;");
   Expect.isTrue(regexp.hasMatch(generated));
 
@@ -104,7 +104,7 @@
   matches.next();
   Expect.isFalse(matches.hasNext());
 
-  generated = compile(PARAMETER_INIT, 'foo');
+  generated = compile(PARAMETER_INIT, entry: 'foo');
   regexp = const RegExp("var result = start;");
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/redundant_phi_eliminator_test.dart b/tests/compiler/dart2js/redundant_phi_eliminator_test.dart
index a038e46..0dac7ba 100644
--- a/tests/compiler/dart2js/redundant_phi_eliminator_test.dart
+++ b/tests/compiler/dart2js/redundant_phi_eliminator_test.dart
@@ -27,11 +27,11 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   RegExp regexp = const RegExp("toBeRemoved");
   Expect.isTrue(!regexp.hasMatch(generated));
 
-  generated = compile(TEST_TWO, 'foo');
+  generated = compile(TEST_TWO, entry: 'foo');
   regexp = const RegExp("toBeRemoved");
   Expect.isTrue(!regexp.hasMatch(generated));
   regexp = const RegExp("temp");
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index fe4db71c..96c820a 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -2,17 +2,17 @@
 // 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:uri');
+import 'dart:uri';
 
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import("../../../lib/compiler/implementation/scanner/scannerlib.dart");
-#import("../../../lib/compiler/implementation/universe/universe.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import("compiler_helper.dart");
-#import("mock_compiler.dart");
-#import("parser_helper.dart");
+import "../../../lib/compiler/implementation/dart2jslib.dart"
+    hide TreeElementMapping, TreeElements;
+import "../../../lib/compiler/implementation/resolution/resolution.dart";
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import "../../../lib/compiler/implementation/util/util.dart";
+import "compiler_helper.dart";
+import "mock_compiler.dart";
+import "parser_helper.dart";
 
 Node buildIdentifier(String name) => new Identifier(scan(name));
 
@@ -555,10 +555,10 @@
 
 resolveConstructor(String script, String statement, String className,
                    String constructor, int expectedElementCount,
-                   [List expectedWarnings = const [],
-                    List expectedErrors = const [],
-                    String corelib = DEFAULT_CORELIB]) {
-  MockCompiler compiler = new MockCompiler(corelib);
+                   {List expectedWarnings: const [],
+                    List expectedErrors: const [],
+                    String corelib: DEFAULT_CORELIB}) {
+  MockCompiler compiler = new MockCompiler(coreSource: corelib);
   compiler.parseScript(script);
   compiler.resolveStatement(statement);
   ClassElement classElement =
@@ -630,21 +630,24 @@
                 A() : a.foo = 1;
                 }""";
   resolveConstructor(script, "A a = new A();", "A", "A", 0,
-                     [], [MessageKind.INVALID_RECEIVER_IN_INITIALIZER]);
+                     expectedWarnings: [],
+                     expectedErrors:
+                         [MessageKind.INVALID_RECEIVER_IN_INITIALIZER]);
 
   script = """class A {
                 int foo;
                 A() : this.foo = 1, this.foo = 2;
               }""";
   resolveConstructor(script, "A a = new A();", "A", "A", 2,
-                     [MessageKind.ALREADY_INITIALIZED],
-                     [MessageKind.DUPLICATE_INITIALIZER]);
+                     expectedWarnings: [MessageKind.ALREADY_INITIALIZED],
+                     expectedErrors: [MessageKind.DUPLICATE_INITIALIZER]);
 
   script = """class A {
                 A() : this.foo = 1;
               }""";
   resolveConstructor(script, "A a = new A();", "A", "A", 0,
-                     [], [MessageKind.CANNOT_RESOLVE]);
+                     expectedWarnings: [],
+                     expectedErrors: [MessageKind.CANNOT_RESOLVE]);
 
   script = """class A {
                 int foo;
@@ -652,22 +655,23 @@
                 A() : this.foo = bar;
               }""";
   resolveConstructor(script, "A a = new A();", "A", "A", 3,
-                     [], [MessageKind.NO_INSTANCE_AVAILABLE]);
+                     expectedWarnings: [],
+                     expectedErrors: [MessageKind.NO_INSTANCE_AVAILABLE]);
 
   script = """class A {
                 int foo() => 42;
                 A() : foo();
               }""";
   resolveConstructor(script, "A a = new A();", "A", "A", 0,
-                     [], [MessageKind.CONSTRUCTOR_CALL_EXPECTED]);
+                     expectedWarnings: [],
+                     expectedErrors: [MessageKind.CONSTRUCTOR_CALL_EXPECTED]);
 
   script = """class A {
                 int i;
                 A.a() : this.b(0);
                 A.b(int i);
               }""";
-  resolveConstructor(script, "A a = new A.a();", "A", "a", 1,
-                     [], []);
+  resolveConstructor(script, "A a = new A.a();", "A", "a", 1);
 
   script = """class A {
                 int i;
@@ -675,7 +679,9 @@
                 A(int i);
               }""";
   resolveConstructor(script, "A a = new A.a();", "A", "a", 2,
-                     [], [MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER]);
+                     expectedWarnings: [],
+                     expectedErrors:
+                         [MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER]);
 
   script = """class A {
                 int i;
@@ -684,8 +690,7 @@
               class B extends A {
                 B() : super(0);
               }""";
-  resolveConstructor(script, "B a = new B();", "B", "B", 1,
-                     [], []);
+  resolveConstructor(script, "B a = new B();", "B", "B", 1);
 
   script = """class A {
                 int i;
@@ -695,7 +700,8 @@
                 B() : super(0), super(1);
               }""";
   resolveConstructor(script, "B b = new B();", "B", "B", 2,
-                     [], [MessageKind.DUPLICATE_SUPER_INITIALIZER]);
+                     expectedWarnings: [],
+                     expectedErrors: [MessageKind.DUPLICATE_SUPER_INITIALIZER]);
 
   script = "";
   final String CORELIB_WITH_INVALID_OBJECT =
@@ -707,12 +713,14 @@
          class num {}
          class Function {}
          class List {}
+         class Map {}
          class Closure {}
          class Null {}
          class Dynamic_ {}
          class Object { Object() : super(); }''';
   resolveConstructor(script, "Object o = new Object();", "Object", "Object", 1,
-                     [], [MessageKind.SUPER_INITIALIZER_IN_OBJECT],
+                     expectedWarnings: [],
+                     expectedErrors: [MessageKind.SUPER_INITIALIZER_IN_OBJECT],
                      corelib: CORELIB_WITH_INVALID_OBJECT);
 }
 
diff --git a/tests/compiler/dart2js/scanner_offset_length_test.dart b/tests/compiler/dart2js/scanner_offset_length_test.dart
index e257277..8c158b9 100644
--- a/tests/compiler/dart2js/scanner_offset_length_test.dart
+++ b/tests/compiler/dart2js/scanner_offset_length_test.dart
@@ -5,7 +5,8 @@
 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
 #import('../../../lib/compiler/implementation/scanner/scanner_implementation.dart');
 
-Token scan(String text) => new StringScanner(text, true).tokenize();
+Token scan(String text) =>
+    new StringScanner(text, includeComments: true).tokenize();
 
 check(String text) {
   Token token = scan(text);
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index cd9fb2c..ee01064 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -2,12 +2,12 @@
 // 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:uri');
+import 'dart:uri';
 
-#import("../../../lib/compiler/implementation/leg.dart");
-#import('../../../lib/compiler/implementation/source_file.dart');
-#import("mock_compiler.dart");
-#import('parser_helper.dart');
+import "../../../lib/compiler/implementation/dart2jslib.dart";
+import '../../../lib/compiler/implementation/source_file.dart';
+import "mock_compiler.dart";
+import 'parser_helper.dart';
 
 CodeBuffer compileAll(SourceFile sourceFile) {
   MockCompiler compiler = new MockCompiler();
diff --git a/tests/compiler/dart2js/ssa_phi_codegen_test.dart b/tests/compiler/dart2js/ssa_phi_codegen_test.dart
index 3f66613..7f02650 100644
--- a/tests/compiler/dart2js/ssa_phi_codegen_test.dart
+++ b/tests/compiler/dart2js/ssa_phi_codegen_test.dart
@@ -42,49 +42,33 @@
 
 const String TEST_FOUR = r"""
 foo() {
-  var cond1 = true;
-  var cond2 = false;
-  for (var i = 0; cond1; i = i + 1) {
-    if (i == 9) cond1 = false;
-    for (var j = 0; cond2; j = j + 1) {
-      if (j == 9) cond2 = false;
+  var a = true;
+  var b = false;
+  for (var i = 0; a; i = i + 1) {
+    if (i == 9) a = false;
+    for (var j = 0; b; j = j + 1) {
+      if (j == 9) b = false;
     }
   }
-  print(cond1);
-  print(cond2);
+  print(a);
+  print(b);
 }
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
-  Expect.isTrue(generated.contains('var a = bar === true ? 2 : 3;'));
-  Expect.isTrue(generated.contains('print(a);'));
+  compileAndMatchFuzzy(TEST_ONE, 'foo', "var x = x === true \\? 2 : 3;");
+  compileAndMatchFuzzy(TEST_ONE, 'foo', "print\\(x\\);");
 
-  generated = compile(TEST_TWO, 'main');
-  RegExp regexp = new RegExp("t \\+= 10");
-  Expect.isTrue(regexp.hasMatch(generated));
+  compileAndMatchFuzzy(TEST_TWO, 'main', "x \\+= 10");
+  compileAndMatchFuzzy(TEST_TWO, 'main', "\\+\\+x");
 
-  regexp = new RegExp("\\+\\+i");
-  Expect.isTrue(regexp.hasMatch(generated));
-
-  generated = compile(TEST_THREE, 'foo');
-
-  // Check that we don't have 'val = val'.
-  regexp = const RegExp("val = val;");
-  Expect.isTrue(!regexp.hasMatch(generated));
-
-  regexp = const RegExp("return val");
-  Expect.isTrue(regexp.hasMatch(generated));
+  // Check that we don't have 'd = d' (using regexp back references).
+  compileAndDoNotMatchFuzzy(TEST_THREE, 'foo', '(x) = \1');
+  compileAndMatchFuzzy(TEST_THREE, 'foo', 'return x');
   // Check that a store just after the declaration of the local
   // only generates one instruction.
-  regexp = const RegExp(r"val = 42");
-  Expect.isTrue(regexp.hasMatch(generated));
+  compileAndMatchFuzzy(TEST_THREE, 'foo', 'x = 42');
 
-  generated = compile(TEST_FOUR, 'foo');
-
-  regexp = const RegExp("cond1 = cond1;");
-  Expect.isTrue(!regexp.hasMatch(generated));
-
-  regexp = const RegExp("cond2 = cond2;");
-  Expect.isTrue(!regexp.hasMatch(generated));
+  var generated = compile(TEST_FOUR, entry: 'foo');
+  compileAndDoNotMatchFuzzy(TEST_FOUR, 'foo', '(x) = \1;');
 }
diff --git a/tests/compiler/dart2js/string_escapes_test.dart b/tests/compiler/dart2js/string_escapes_test.dart
index a72e9ff..5b61034 100644
--- a/tests/compiler/dart2js/string_escapes_test.dart
+++ b/tests/compiler/dart2js/string_escapes_test.dart
@@ -8,7 +8,7 @@
 
 String compileExpression(String expression) {
   var source = "foo() { return $expression; }";
-  return compile(source, "foo");
+  return compile(source, entry: "foo");
 }
 
 main() {
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index 9896ead..0dd4f1e 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -2,13 +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.
 
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import("mock_compiler.dart");
-#import("parser_helper.dart");
+import "../../../lib/compiler/implementation/dart2jslib.dart" hide SourceString;
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import '../../../lib/compiler/implementation/scanner/scannerlib.dart';
+import "../../../lib/compiler/implementation/util/util.dart";
+import "mock_compiler.dart";
+import "parser_helper.dart";
 
 DartType intType;
 DartType boolType;
diff --git a/tests/compiler/dart2js/type_equals_test.dart b/tests/compiler/dart2js/type_equals_test.dart
index 2936a06b..7a24174 100644
--- a/tests/compiler/dart2js/type_equals_test.dart
+++ b/tests/compiler/dart2js/type_equals_test.dart
@@ -2,13 +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.
 
-#import("../../../lib/compiler/implementation/leg.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart");
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import("../../../lib/compiler/implementation/util/util.dart");
-#import("compiler_helper.dart");
-#import("parser_helper.dart");
-#import("dart:uri");
+import "../../../lib/compiler/implementation/dart2jslib.dart";
+import "../../../lib/compiler/implementation/elements/elements.dart";
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import "../../../lib/compiler/implementation/util/util.dart";
+import "compiler_helper.dart";
+import "parser_helper.dart";
+import "dart:uri";
 
 bool test(compiler, String name1, String name2, {bool expect}) {
   Expect.isTrue(?expect, 'required parameter "expect" not given');
diff --git a/tests/compiler/dart2js/type_guard_unuser_test.dart b/tests/compiler/dart2js/type_guard_unuser_test.dart
index 367b62b..5a6ee89 100644
--- a/tests/compiler/dart2js/type_guard_unuser_test.dart
+++ b/tests/compiler/dart2js/type_guard_unuser_test.dart
@@ -6,9 +6,9 @@
 
 const String TEST_ONE = r"""
 foo(a) {
-  int c = foo(true);
-  if (a) c = foo(2);
-  return c;
+  int b = foo(true);
+  if (a) b = foo(2);
+  return b;
 }
 """;
 
@@ -24,42 +24,42 @@
 """;
 
 const String TEST_THREE = r"""
-foo(int param1, int param2) {
-  return 0 + param1 + param2;
+foo(int a, int b) {
+  return 0 + a + b;
 }
 """;
 
 const String TEST_THREE_WITH_BAILOUT = r"""
-foo(int param1, int param2) {
+foo(int a, int b) {
   var t;
   for (int i = 0; i < 1; i++) {
-    t = 0 + param1 + param2;
+    t = 0 + a + b;
   }
   return t;
 }
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
   RegExp regexp = new RegExp(getIntTypeCheck(anyIdentifier));
   Iterator<Match> matches = regexp.allMatches(generated).iterator();
   checkNumberOfMatches(matches, 0);
-  Expect.isTrue(generated.contains(r'return a === true ? $.foo(2) : c;'));
+  Expect.isTrue(generated.contains(r'return a === true ? $.foo(2) : b;'));
 
-  generated = compile(TEST_TWO, 'foo');
+  generated = compile(TEST_TWO, entry: 'foo');
   regexp = const RegExp("foo\\(1\\)");
   matches = regexp.allMatches(generated).iterator();
   checkNumberOfMatches(matches, 1);
 
-  generated = compile(TEST_THREE, 'foo');
-  regexp = new RegExp(getNumberTypeCheck('param1'));
+  generated = compile(TEST_THREE, entry: 'foo');
+  regexp = new RegExp(getNumberTypeCheck('a'));
   Expect.isTrue(regexp.hasMatch(generated));
-  regexp = new RegExp(getNumberTypeCheck('param2'));
+  regexp = new RegExp(getNumberTypeCheck('b'));
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(TEST_THREE_WITH_BAILOUT, 'foo');
-  regexp = new RegExp(getNumberTypeCheck('param1'));
+  generated = compile(TEST_THREE_WITH_BAILOUT, entry: 'foo');
+  regexp = new RegExp(getNumberTypeCheck('a'));
   Expect.isTrue(regexp.hasMatch(generated));
-  regexp = new RegExp(getNumberTypeCheck('param2'));
+  regexp = new RegExp(getNumberTypeCheck('b'));
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/type_inference2_test.dart b/tests/compiler/dart2js/type_inference2_test.dart
index 594c321..7d87645 100644
--- a/tests/compiler/dart2js/type_inference2_test.dart
+++ b/tests/compiler/dart2js/type_inference2_test.dart
@@ -13,6 +13,5 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'sum');
-  Expect.isTrue(generated.contains('++i'));
+  compileAndMatchFuzzy(TEST_ONE, 'sum', r"\+\+x");
 }
diff --git a/tests/compiler/dart2js/type_inference3_test.dart b/tests/compiler/dart2js/type_inference3_test.dart
index 70fabe8..7504761 100644
--- a/tests/compiler/dart2js/type_inference3_test.dart
+++ b/tests/compiler/dart2js/type_inference3_test.dart
@@ -13,9 +13,9 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'sum');
-  RegExp regexp = new RegExp(getNumberTypeCheck('param0'));
+  String generated = compile(TEST_ONE, entry: 'sum');
+  RegExp regexp = new RegExp(getNumberTypeCheck('(param0|a)'));
   Expect.isTrue(regexp.hasMatch(generated));
-  regexp = new RegExp(getNumberTypeCheck('param1'));
+  regexp = new RegExp(getNumberTypeCheck('(param1|b)'));
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/type_inference4_test.dart b/tests/compiler/dart2js/type_inference4_test.dart
index 4690202..52ac6b44 100644
--- a/tests/compiler/dart2js/type_inference4_test.dart
+++ b/tests/compiler/dart2js/type_inference4_test.dart
@@ -6,22 +6,22 @@
 
 const String TEST_ONE = r"""
 foo(j) {
-  var a = [1, 2, 3];
+  var array = [1, 2, 3];
   if (j < 0) j = 0;
   for (var i = j; i < 3; i++) {
-    a[i];
+    array[i];
   }
 }
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
 
   // Test for absence of an illegal argument exception. This means that the
   // arguments are known to be integers.
   Expect.isFalse(generated.contains('iae'));
   // Also make sure that we are not just in bailout mode without speculative
   // types by grepping for the integer-bailout check on argument j.
-  RegExp regexp = new RegExp(getIntTypeCheck('j'));
+  RegExp regexp = new RegExp(getIntTypeCheck('[aj]'));
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/type_inference5_test.dart b/tests/compiler/dart2js/type_inference5_test.dart
index aa850bb..2382de7 100644
--- a/tests/compiler/dart2js/type_inference5_test.dart
+++ b/tests/compiler/dart2js/type_inference5_test.dart
@@ -14,13 +14,16 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'foo');
+  String generated = compile(TEST_ONE, entry: 'foo');
 
   // Test for absence of an illegal argument exception. This means that the
   // arguments are known to be integers.
   Expect.isFalse(generated.contains('iae'));
   // Also make sure that we are not just in bailout mode without speculative
   // types by grepping for the integer-bailout check on argument j.
-  RegExp regexp = new RegExp(getIntTypeCheck('j'));
+  var argname =
+      const RegExp(r'function(?: [a-z]+)?\(([a-zA-Z0-9_]+)\)').firstMatch(generated)[1];
+  print(argname);
+  RegExp regexp = new RegExp(getIntTypeCheck(argname));
   Expect.isTrue(regexp.hasMatch(generated));
 }
diff --git a/tests/compiler/dart2js/type_inference_test.dart b/tests/compiler/dart2js/type_inference_test.dart
index 92a8a5a..6958029 100644
--- a/tests/compiler/dart2js/type_inference_test.dart
+++ b/tests/compiler/dart2js/type_inference_test.dart
@@ -5,38 +5,38 @@
 #import("compiler_helper.dart");
 
 const String TEST_ONE = r"""
-sum(param0, param1) {
-  var sum = 0;
-  for (var i = param0; i < param1; i += 1) sum = sum + i;
-  return sum;
+sum(a, b) {
+  var c = 0;
+  for (var d = a; d < b; d += 1) c = c + d;
+  return c;
 }
 """;
 
 const String TEST_TWO = r"""
-foo(int param0) {
-  return -param0;
+foo(int a) {
+  return -a;
 }
 """;
 
 const String TEST_TWO_WITH_BAILOUT = r"""
-foo(int param0) {
-  for (int i = 0; i < 1; i++) {
-    param0 = -param0;
+foo(int a) {
+  for (int b = 0; b < 1; b++) {
+    a = -a;
   }
-  return param0;
+  return a;
 }
 """;
 
 const String TEST_THREE = r"""
-foo(c) {
-  for (int i = 0; i < 10; i++) print(c[i]);
+foo(a) {
+  for (int b = 0; b < 10; b++) print(a[b]);
 }
 """;
 
 const String TEST_FOUR = r"""
-foo(String c) {
-  print(c[0]); // Force a type guard.
-  while (true) print(c.length);
+foo(String a) {
+  print(a[0]); // Force a type guard.
+  while (true) print(a.length);
 }
 """;
 
@@ -66,45 +66,44 @@
 """;
 
 main() {
-  String generated = compile(TEST_ONE, 'sum');
-  Expect.isTrue(generated.contains('sum += i'));
-  Expect.isTrue(generated.contains("typeof param1 !== 'number'"));
+  compileAndMatchFuzzy(TEST_ONE, 'sum', "x \\+= x");
+  compileAndMatchFuzzy(TEST_ONE, 'sum', "typeof x !== 'number'");
 
-  generated = compile(TEST_TWO, 'foo');
-  RegExp regexp = new RegExp(getNumberTypeCheck('param0'));
+  var generated = compile(TEST_TWO, entry: 'foo');
+  RegExp regexp = new RegExp(getNumberTypeCheck('a'));
   Expect.isTrue(!regexp.hasMatch(generated));
 
-  regexp = const RegExp('-param0');
+  regexp = const RegExp('-a');
   Expect.isTrue(!regexp.hasMatch(generated));
 
-  generated = compile(TEST_TWO_WITH_BAILOUT, 'foo');
-  regexp = new RegExp(getNumberTypeCheck('param0'));
+  generated = compile(TEST_TWO_WITH_BAILOUT, entry: 'foo');
+  regexp = new RegExp(getNumberTypeCheck('a'));
   Expect.isTrue(regexp.hasMatch(generated));
 
-  regexp = const RegExp('-param0');
+  regexp = const RegExp('-a');
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(TEST_THREE, 'foo');
-  regexp = new RegExp("c[$anyIdentifier]");
+  generated = compile(TEST_THREE, entry: 'foo');
+  regexp = new RegExp("a[$anyIdentifier]");
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(TEST_FOUR, 'foo');
-  regexp = new RegExp("c.length");
+  generated = compile(TEST_FOUR, entry: 'foo');
+  regexp = new RegExp("a.length");
   Expect.isTrue(regexp.hasMatch(generated));
 
-  generated = compile(TEST_FIVE, 'foo');
+  generated = compile(TEST_FIVE, entry: 'foo');
   regexp = const RegExp('a.constructor !== Array');
   Expect.isTrue(!regexp.hasMatch(generated));
   Expect.isTrue(generated.contains('index'));
   Expect.isTrue(generated.contains('indexSet'));
 
-  generated = compile(TEST_FIVE_WITH_BAILOUT, 'foo');
+  generated = compile(TEST_FIVE_WITH_BAILOUT, entry: 'foo');
   regexp = const RegExp('a.constructor !== Array');
   Expect.isTrue(regexp.hasMatch(generated));
   Expect.isTrue(!generated.contains('index'));
   Expect.isTrue(!generated.contains('indexSet'));
 
-  generated = compile(TEST_SIX, 'foo');
+  generated = compile(TEST_SIX, entry: 'foo');
   regexp = const RegExp('a.constructor !== Array');
   Expect.isTrue(regexp.hasMatch(generated));
   Expect.isTrue(!generated.contains('index'));
diff --git a/tests/compiler/dart2js/unparser2_test.dart b/tests/compiler/dart2js/unparser2_test.dart
index e99587f..671615a 100644
--- a/tests/compiler/dart2js/unparser2_test.dart
+++ b/tests/compiler/dart2js/unparser2_test.dart
@@ -2,10 +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.
 
-#import("../../../lib/compiler/implementation/scanner/scannerlib.dart");
-#import("../../../lib/compiler/implementation/elements/elements.dart"); // only need CompilationUnitElement
-#import("../../../lib/compiler/implementation/tree/tree.dart");
-#import("../../../lib/compiler/implementation/leg.dart"); // only need DiagnosticListener & Script
+import "../../../lib/compiler/implementation/scanner/scannerlib.dart";
+import "../../../lib/compiler/implementation/elements/elements.dart" show CompilationUnitElement, LibraryElement;
+import "../../../lib/compiler/implementation/tree/tree.dart";
+import "../../../lib/compiler/implementation/dart2jslib.dart" show DiagnosticListener, Script;
 
 main() {
   testClassDef();
@@ -64,7 +64,7 @@
   MessageCollector() {
     messages = [];
   }
-  void cancel([String reason, node, token, instruction, element]) {
+  void cancel(String reason, {node, token, instruction, element}) {
     messages.add(reason);
     throw reason;
   }
@@ -75,8 +75,8 @@
     throw message;
   }
   void internalError(String message,
-                     [Node node, Token token, dynamic instruction,
-                      Element element]) {
+                     {Node node, Token token, dynamic instruction,
+                      Element element}) {
     throw message;
   }
 }
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index bb824b3..10ac315 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -208,39 +208,77 @@
   testUnparseTopLevelWithMetadata('export "søhest" hide a,show hide a,show;');
 }
 
+testUnparseMemberAndAsMemberOfFoo(String code) {
+  testUnparseMember(code);
+  testUnparseTopLevelWithMetadata('class Foo{$code}');
+}
+
 testRedirectingFactoryConstructors() {
-  testUnparseMember("factory Foo() = Bar;");
-  testUnparseMember("factory Foo() = Bar.baz;");
-  testUnparseMember("factory Foo() = Bar<T>;");
-  testUnparseMember("factory Foo() = Bar<T>.baz;");
-  testUnparseMember("factory Foo() = prefix.Bar;");
-  testUnparseMember("factory Foo() = prefix.Bar.baz;");
-  testUnparseMember("factory Foo() = prefix.Bar<T>;");
-  testUnparseMember("factory Foo() = prefix.Bar<T>.baz;");
-  testUnparseMember("const factory Foo() = Bar;");
-  testUnparseMember("const factory Foo() = Bar.baz;");
-  testUnparseMember("const factory Foo() = Bar<T>;");
-  testUnparseMember("const factory Foo() = Bar<T>.baz;");
-  testUnparseMember("const factory Foo() = prefix.Bar;");
-  testUnparseMember("const factory Foo() = prefix.Bar.baz;");
-  testUnparseMember("const factory Foo() = prefix.Bar<T>;");
-  testUnparseMember("const factory Foo() = prefix.Bar<T>.baz;");
-  testUnparseMember("external factory Foo() = Bar;");
-  testUnparseMember("external factory Foo() = Bar.baz;");
-  testUnparseMember("external factory Foo() = Bar<T>;");
-  testUnparseMember("external factory Foo() = Bar<T>.baz;");
-  testUnparseMember("external factory Foo() = prefix.Bar;");
-  testUnparseMember("external factory Foo() = prefix.Bar.baz;");
-  testUnparseMember("external factory Foo() = prefix.Bar<T>;");
-  testUnparseMember("external factory Foo() = prefix.Bar<T>.baz;");
-  testUnparseMember("external const factory Foo() = Bar;");
-  testUnparseMember("external const factory Foo() = Bar.baz;");
-  testUnparseMember("external const factory Foo() = Bar<T>;");
-  testUnparseMember("external const factory Foo() = Bar<T>.baz;");
-  testUnparseMember("external const factory Foo() = prefix.Bar;");
-  testUnparseMember("external const factory Foo() = prefix.Bar.baz;");
-  testUnparseMember("external const factory Foo() = prefix.Bar<T>;");
-  testUnparseMember("external const factory Foo() = prefix.Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = Bar;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = prefix.Bar;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = prefix.Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = prefix.Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = prefix.Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo("factory Foo() = prefix.Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "factory Foo() = prefix.Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = Bar;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "const factory Foo() = Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = prefix.Bar;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = prefix.Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = prefix.Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "const factory Foo() = prefix.Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo("const factory Foo() = prefix.Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "const factory Foo() = prefix.Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = Bar;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external factory Foo() = Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = prefix.Bar;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = prefix.Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("external factory Foo() = prefix.Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external factory Foo() = prefix.Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external factory Foo() = prefix.Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external factory Foo() = prefix.Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo("external const factory Foo() = Bar;");
+  testUnparseMemberAndAsMemberOfFoo("external const factory Foo() = Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo("external const factory Foo() = Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = Bar<List<T>,T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = prefix.Bar;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = prefix.Bar.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = prefix.Bar<T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = prefix.Bar<List<T>,T>;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = prefix.Bar<T>.baz;");
+  testUnparseMemberAndAsMemberOfFoo(
+      "external const factory Foo() = prefix.Bar<List<T>,T>.baz;");
 }
 
 testClassDeclarations() {
diff --git a/tests/compiler/dart2js/value_range2_test.dart b/tests/compiler/dart2js/value_range2_test.dart
index ba2edab..ac23203 100644
--- a/tests/compiler/dart2js/value_range2_test.dart
+++ b/tests/compiler/dart2js/value_range2_test.dart
@@ -2,8 +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.
 
-#import("../../../lib/compiler/implementation/ssa/ssa.dart");
-#import("../../../lib/compiler/implementation/leg.dart");
+import "../../../lib/compiler/implementation/ssa/ssa.dart";
+import "../../../lib/compiler/implementation/dart2jslib.dart";
 
 Value instructionValue = new InstructionValue(new HReturn(null));
 Value lengthValue = new LengthValue(new HReturn(null));
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index f24783d..f798b88 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -21,7 +21,7 @@
 operator_test: Skip
 string_interpolation_test: Skip
 
-[ $compiler == dart2js && $runtime == ie ]
+[ $compiler == dart2js && $runtime == ie9 ]
 class_test: Fail
 
 [ $compiler == dart2js && $runtime == none ]
diff --git a/tests/compiler/dart2js_extra/runtime_type_isolate.dart b/tests/compiler/dart2js_extra/runtime_type_isolate.dart
new file mode 100644
index 0000000..9be80f5
--- /dev/null
+++ b/tests/compiler/dart2js_extra/runtime_type_isolate.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2012, 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:isolate';
+
+class Bar {}
+
+main() {
+  final port = new ReceivePort();
+  port.receive((msg, reply) {
+    Expect.equals(new Bar().runtimeType.toString(), 'Bar');
+  });
+  port.toSendPort().send(null, null);
+}
diff --git a/tests/corelib/big_integer_vm_test.dart b/tests/corelib/big_integer_vm_test.dart
index 7c54a8c..ec1d755 100644
--- a/tests/corelib/big_integer_vm_test.dart
+++ b/tests/corelib/big_integer_vm_test.dart
@@ -106,7 +106,7 @@
     Expect.equals(500000000.0, b / a);
   }
 
-  static testBigintRemainder() {
+  static testBigintModulo() {
     // Bigint and Smi.
     var a = 1000000000005;
     var b = 10;
@@ -122,6 +122,15 @@
     b = 100000000000;
     Expect.equals(1.0, a % b);
     Expect.equals(100000000000.0, b % a);
+    // Transitioning from Mint to Bigint.
+    var iStart = 4611686018427387900;
+    var prevX = -23 % iStart;
+    for (int i = iStart + 1; i < iStart + 10; i++) {
+      var x = -23 % i;
+      Expect.equals(1, x - prevX);
+      Expect.isTrue(x > 0);
+      prevX = x;
+    }
   }
 
   static testBigintNegate() {
@@ -138,7 +147,7 @@
     bool exceptionCaught = false;
     try {
       var a = 1 << 1111111111111111111111111111;
-    } on OutOfMemoryException catch (e) {
+    } on OutOfMemoryError catch (e) {
       exceptionCaught = true;
     }
     Expect.equals(true, exceptionCaught);
@@ -150,7 +159,7 @@
     testBigintAdd();
     testBigintSub();
     testBigintMul();
-    testBigintRemainder();
+    testBigintModulo();
     testBigintTruncDiv();
     testBigintDiv();
     testBigintNegate();
diff --git a/tests/corelib/collection_contains_test.dart b/tests/corelib/collection_contains_test.dart
new file mode 100644
index 0000000..168855b
--- /dev/null
+++ b/tests/corelib/collection_contains_test.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2012, 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 the contains methods on lists.
+
+test(list, notInList) {
+  testList(list) {
+    for (int i = 0; i < list.length; i++) {
+      var elem = list[i];
+      Expect.isTrue(list.contains(list[i]), "$list.contains($elem)");
+    }
+    Expect.isFalse(list.contains(notInList), "!$list.contains($notInList)");
+  }
+  List fixedList = new List(list.length);
+  List growList = new List();
+  for (int i = 0; i < list.length; i++) {
+    fixedList[i] = list[i];
+    growList.add(list[i]);
+  }
+  testList(list);
+  testList(fixedList);
+  testList(growList);
+}
+
+class C {
+  const C();
+}
+
+class Niet {
+  bool operator==(other) => false;
+}
+
+main() {
+  test(const <String>["a", "b", "c", null], "d");
+  test(const <int>[1, 2, 3, null], 0);
+  test(const <bool>[true, false], null);
+  test(const <C>[const C(), const C(), null], new C());
+  test(<C>[new C(), new C(), new C(), null], new C());
+  test(const <double>[ 0.0, 1.0, 5e-324, 1e+308, double.INFINITY ], 2.0);
+  Expect.isTrue(const <double>[-0.0].contains(0.0));
+  Expect.isFalse(const <double>[double.NAN].contains(double.NAN));
+  var niet = new Niet();
+  Expect.isFalse([niet].contains(niet));
+}
diff --git a/tests/corelib/collection_to_string_test.dart b/tests/corelib/collection_to_string_test.dart
index f314316..71db90ff 100644
--- a/tests/corelib/collection_to_string_test.dart
+++ b/tests/corelib/collection_to_string_test.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 /**
- * Tests for the toString methods on collections (including maps).
+ * Tests for the toString methods on collections and maps.
  */
 
 #library('collection_to_string');
@@ -115,14 +115,14 @@
  * If exact is true, the returned collections will not be, and will not contain
  * a collection with ill-defined iteration order (i.e., a HashSet or HashMap).
  */
-Object randomCollection(int size, StringBuffer stringRep, [bool exact]) {
+Object randomCollection(int size, StringBuffer stringRep, {bool exact}) {
   return randomCollectionHelper(size, exact, stringRep, []);
 }
 
 /**
  * Return a random collection (or map) of the specified size, placing its
  * string representation into the given string buffer. The beingMade
- * parameter is a list of collections currently under construction, i.e., 
+ * parameter is a list of collections currently under construction, i.e.,
  * candidates for recursive references.
  *
  * If exact is true, the returned collections will not be, and will not contain
@@ -156,7 +156,7 @@
 /**
  * Return a random List of the specified size, placing its string
  * representation into the given string buffer. The beingMade
- * parameter is a list of collections currently under construction, i.e., 
+ * parameter is a list of collections currently under construction, i.e.,
  * candidates for recursive references.
  *
  * If exact is true, the returned collections will not be, and will not contain
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 9494bfe..54df65e 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -11,14 +11,14 @@
 apply_test: Fail # Bug 5670
 apply2_test: Fail # Bug 5670
 
-[ $runtime == ff || $runtime == ie ]
+[ $runtime == ff || $runtime == ie9 ]
 unicode_test: Fail
 
 # TODO(jmesserly): now that we have a bot, we need to set up Opera testing.
 [ $runtime == opera ]
 *: Skip
 
-[ $runtime == ie && ($system == linux || $system == macos) ]
+[ $runtime == ie9 && ($system == linux || $system == macos) ]
 *: Skip
 
 [ $runtime == safari && ($system == linux || $system == windows) ]
@@ -54,10 +54,7 @@
 [ $compiler == dart2js && $runtime == safari ]
 core_runtime_types_test: Fail
 
-[ $compiler == dart2js && $runtime == ff && $system == windows ]
-null_test: Fail # http://dartbug.com/5523
-
-[ $compiler == dart2js && $runtime == ie ]
+[ $compiler == dart2js && $runtime == ie9 ]
 date_time7_test: Fail # BUG(3304): Maybe this doesn't time out?
 reg_exp_all_matches_test: Fail # BUG(3304): Maybe this doesn't time out?
 string_base_vm_test: Fail # BUG(3304): Maybe this doesn't time out?
diff --git a/tests/corelib/date_time5_test.dart b/tests/corelib/date_time5_test.dart
index ba8a0ca..aa2109e 100644
--- a/tests/corelib/date_time5_test.dart
+++ b/tests/corelib/date_time5_test.dart
@@ -14,7 +14,7 @@
   Expect.equals(0, d.second);
   Expect.equals(0, d.millisecond);
 
-  d = new Date(2012, day: 28);
+  d = new Date(2012, 1, 28);
   Expect.equals(2012, d.year);
   Expect.equals(1, d.month);
   Expect.equals(28, d.day);
@@ -32,7 +32,7 @@
   Expect.equals(0, d.second);
   Expect.equals(0, d.millisecond);
 
-  d = new Date(1970, 3, hour: 11);
+  d = new Date(1970, 3, 1, 11);
   Expect.equals(1970, d.year);
   Expect.equals(3, d.month);
   Expect.equals(1, d.day);
@@ -41,7 +41,7 @@
   Expect.equals(0, d.second);
   Expect.equals(0, d.millisecond);
 
-  d = new Date(0, 12, 24, minute: 12);
+  d = new Date(0, 12, 24, 0, 12);
   Expect.equals(0, d.year);
   Expect.equals(12, d.month);
   Expect.equals(24, d.day);
@@ -50,7 +50,7 @@
   Expect.equals(0, d.second);
   Expect.equals(0, d.millisecond);
 
-  d = new Date(-1, 2, 2, 3, millisecond: 4);
+  d = new Date(-1, 2, 2, 3, 0, 0, 4);
   Expect.equals(-1, d.year);
   Expect.equals(2, d.month);
   Expect.equals(2, d.day);
@@ -59,7 +59,7 @@
   Expect.equals(0, d.second);
   Expect.equals(4, d.millisecond);
 
-  d = new Date(-1, 2, 2, 3, second: 4);
+  d = new Date(-1, 2, 2, 3, 0, 4);
   Expect.equals(-1, d.year);
   Expect.equals(2, d.month);
   Expect.equals(2, d.day);
@@ -68,8 +68,7 @@
   Expect.equals(4, d.second);
   Expect.equals(0, d.millisecond);
 
-  d = new Date(2012, month: 5, day: 15,
-               hour: 13, minute: 21, second: 33, millisecond: 12);
+  d = new Date(2012, 5, 15, 13, 21, 33, 12);
   Expect.equals(2012, d.year);
   Expect.equals(5, d.month);
   Expect.equals(15, d.day);
diff --git a/tests/corelib/date_time8_test.dart b/tests/corelib/date_time8_test.dart
index 255a868..c85b870 100644
--- a/tests/corelib/date_time8_test.dart
+++ b/tests/corelib/date_time8_test.dart
@@ -5,7 +5,7 @@
 // Make sure the year 0 is correctly printed.
 
 testUtc() {
-  var d = new Date(0, 1, 1, isUtc: true);
+  var d = new Date.utc(0, 1, 1);
   Expect.equals("0000-01-01 00:00:00.000Z", d.toString());
 }
 
diff --git a/tests/corelib/date_time_test.dart b/tests/corelib/date_time_test.dart
index 3ea6e58..a60be14 100644
--- a/tests/corelib/date_time_test.dart
+++ b/tests/corelib/date_time_test.dart
@@ -187,9 +187,9 @@
     Expect.equals(59, dt.minute);
     Expect.equals(59, dt.second);
     Expect.equals(999, dt.millisecond);
-    dt = new Date(2035, 1, 1, 0, 0, 0, 1, isUtc: true);
+    dt = new Date.utc(2035, 1, 1, 0, 0, 0, 1);
     Expect.equals(SECONDS_YEAR_2035 * 1000 + 1, dt.millisecondsSinceEpoch);
-    dt = new Date(2034, 12, 31, 23, 59, 59, 999, isUtc: true);
+    dt = new Date.utc(2034, 12, 31, 23, 59, 59, 999);
     Expect.equals(SECONDS_YEAR_2035 * 1000 - 1, dt.millisecondsSinceEpoch);
     dt = new Date.fromMillisecondsSinceEpoch(SECONDS_YEAR_2035 * 1000 + 1);
     Expect.equals(true, (2035 == dt.year && 1 == dt.month && 1 == dt.day) ||
@@ -264,14 +264,14 @@
     Expect.throws(() => new Date(dt.year, dt.month, dt.day,
                                  dt.hour, dt.minute, 0, 1));
     dt = new Date.fromMillisecondsSinceEpoch(8640000000000000, isUtc: true);
-    Expect.throws(() => new Date(dt.year, dt.month, dt.day,
-                                 dt.hour, dt.minute, 0, 1, isUtc: true));
+    Expect.throws(() => new Date.utc(dt.year, dt.month, dt.day,
+                                     dt.hour, dt.minute, 0, 1));
     dt = new Date.fromMillisecondsSinceEpoch(-8640000000000000);
     Expect.throws(() => new Date(dt.year, dt.month, dt.day,
                                  dt.hour, dt.minute, 0, -1));
     dt = new Date.fromMillisecondsSinceEpoch(-8640000000000000, isUtc: true);
-    Expect.throws(() => new Date(dt.year, dt.month, dt.day,
-                                 dt.hour, dt.minute, 0, -1, isUtc: true));
+    Expect.throws(() => new Date.utc(dt.year, dt.month, dt.day,
+                                     dt.hour, dt.minute, 0, -1));
   }
 
   static void testUTCGetters() {
@@ -297,10 +297,8 @@
 
   static void testLocalGetters() {
     var dt1 = new Date.fromMillisecondsSinceEpoch(1305140315000);
-    var dt2 = new Date(dt1.year, dt1.month, dt1.day,
-                       dt1.hour, dt1.minute, dt1.second,
-                       dt1.millisecond,
-                       isUtc: true);
+    var dt2 = new Date.utc(dt1.year, dt1.month, dt1.day,
+                           dt1.hour, dt1.minute, dt1.second, dt1.millisecond);
     Duration zoneOffset = dt1.difference(dt2);
     Expect.equals(true, zoneOffset.inDays == 0);
     Expect.equals(true, zoneOffset.inHours.abs() <= 12);
@@ -318,7 +316,7 @@
   }
 
   static void testConstructors() {
-    var dt0 = new Date(2011, 5, 11, 18, 58, 35, 0, isUtc: true);
+    var dt0 = new Date.utc(2011, 5, 11, 18, 58, 35, 0);
     Expect.equals(1305140315000, dt0.millisecondsSinceEpoch);
     var dt1 = new Date.fromMillisecondsSinceEpoch(1305140315000);
     Expect.equals(dt1.millisecondsSinceEpoch, dt0.millisecondsSinceEpoch);
@@ -337,11 +335,10 @@
     Expect.equals(dt2.millisecondsSinceEpoch, dt3.millisecondsSinceEpoch);
     Expect.equals(true, dt2 == dt3);
     dt1 = new Date.fromMillisecondsSinceEpoch(-9999999, isUtc: true);
-    dt3 = new Date(
-        dt1.year, dt1.month, dt1.day, dt1.hour, dt1.minute,
-        dt1.second, dt1.millisecond, isUtc: true);
+    dt3 = new Date.utc(dt1.year, dt1.month, dt1.day, dt1.hour, dt1.minute,
+                       dt1.second, dt1.millisecond);
     Expect.equals(dt1.millisecondsSinceEpoch, dt3.millisecondsSinceEpoch);
-    dt3 = new Date(99, 1, 2, 10, 11, 12, 0, isUtc: true);
+    dt3 = new Date.utc(99, 1, 2, 10, 11, 12, 0);
     Expect.equals(99, dt3.year);
     Expect.equals(1, dt3.month);
     Expect.equals(2, dt3.day);
@@ -359,7 +356,7 @@
     Expect.equals(0, dt4.second);
     Expect.equals(0, dt4.millisecond);
     Expect.isFalse(dt4.isUtc);
-    var dt5 = new Date(99, 1, 2, isUtc: true);
+    var dt5 = new Date.utc(99, 1, 2);
     Expect.equals(99, dt5.year);
     Expect.equals(1, dt5.month);
     Expect.equals(2, dt5.day);
@@ -377,7 +374,7 @@
     Expect.equals(0, dt6.second);
     Expect.equals(0, dt6.millisecond);
     Expect.isFalse(dt6.isUtc);
-    var dt7 = new Date(2012, 2, 27, 13, 27, 0, isUtc: true);
+    var dt7 = new Date.utc(2012, 2, 27, 13, 27, 0);
     Expect.equals(2012, dt7.year);
     Expect.equals(2, dt7.month);
     Expect.equals(27, dt7.day);
@@ -781,18 +778,18 @@
     // 2011-10-06 is Summertime.
     var d = new Date(2011, 10, 6, 0, 45, 37, 0);
     Expect.equals(Date.THU, d.weekday);
-    d = new Date(2011, 10, 6, 0, 45, 37, 0, isUtc: true);
+    d = new Date.utc(2011, 10, 6, 0, 45, 37, 0);
     Expect.equals(Date.THU, d.weekday);
     d = new Date(2011, 10, 5, 23, 45, 37, 0);
     Expect.equals(Date.WED, d.weekday);
-    d = new Date(2011, 10, 5, 23, 45, 37, 0, isUtc: true);
+    d = new Date.utc(2011, 10, 5, 23, 45, 37, 0);
     Expect.equals(Date.WED, d.weekday);
     // 1970-01-01 is Wintertime.
     d = new Date(1970, 1, 1, 0, 0, 0, 1);
     Expect.equals(Date.THU, d.weekday);
-    d = new Date(1970, 1, 1, 0, 0, 0, 1, isUtc: true);
+    d = new Date.utc(1970, 1, 1, 0, 0, 0, 1);
     Expect.equals(Date.THU, d.weekday);
-    d = new Date(1969, 12, 31, 23, 59, 59, 999, isUtc: true);
+    d = new Date.utc(1969, 12, 31, 23, 59, 59, 999);
     Expect.equals(Date.WED, d.weekday);
     d = new Date(1969, 12, 31, 23, 59, 59, 999);
     Expect.equals(Date.WED, d.weekday);
diff --git a/tests/corelib/exception_implementation_test.dart b/tests/corelib/exception_implementation_test.dart
index 23b772a..60eb28e 100644
--- a/tests/corelib/exception_implementation_test.dart
+++ b/tests/corelib/exception_implementation_test.dart
@@ -3,7 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 #library("ExceptionImplementationTest.dart");
-#import("dart:coreimpl");
 
 main() {
   final msg = 1;
@@ -12,7 +11,6 @@
     Expect.fail("Unreachable");
   } on Exception catch (e) {
     Expect.isTrue(e is Exception);
-    Expect.isTrue(e is ExceptionImplementation);
     Expect.equals("Exception: $msg", e.toString());
   }
 }
diff --git a/tests/corelib/future_test.dart b/tests/corelib/future_test.dart
index 4544a18..ebc541f 100644
--- a/tests/corelib/future_test.dart
+++ b/tests/corelib/future_test.dart
@@ -74,7 +74,7 @@
   completer.completeException(exception);
   Expect.equals(exception, future.exception);
   Expect.equals(exception, err);
-  Expect.throws(() => future.value, check: (e) => e == exception);
+  Expect.throws(() => future.value, (e) => e == exception);
 }
 
 testCompleteWithCompleteHandlerAfterComplete() {
@@ -108,7 +108,7 @@
   });
   Expect.equals(exception, future.exception);
   Expect.equals(exception, err);
-  Expect.throws(() => future.value, check: (e) => e == exception);
+  Expect.throws(() => future.value, (e) => e == exception);
 }
 
 testCompleteWithManyCompleteHandlers() {
@@ -146,7 +146,7 @@
   Expect.equals(exception, before);
   Expect.equals(exception, after1);
   Expect.equals(exception, after2);
-  Expect.throws(() => future.value, check: (e) => e == exception);
+  Expect.throws(() => future.value, (e) => e == exception);
 }
 
 // Tests for [then]
@@ -207,7 +207,7 @@
   future.then((_) {}); // exception is thrown if we plan to use the value
   Expect.throws(
       () { completer.completeException(ex); },
-      check: (e) => e == ex);
+      (e) => e == ex);
 }
 
 testExceptionNoSuccessListeners() {
@@ -263,7 +263,7 @@
   future.handleException((e) { reached = true; return false; }); // overshadowed
   Expect.throws(
       () { completer.completeException(ex); },
-      check: (e) => e == ex);
+      (e) => e == ex);
   Expect.isTrue(reached);
 }
 
@@ -385,7 +385,7 @@
     exceptionFromCompleteHandler = f.exception;
   });
   future.then((v) => Expect.fail("Should not succeed"));
-  Expect.throws(() => completer.completeException(ex), check: (e) => ex == e);
+  Expect.throws(() => completer.completeException(ex), (e) => ex == e);
   Expect.equals(ex, exceptionFromCompleteHandler);
 }
 
@@ -438,7 +438,7 @@
   final transformedFuture = completer.future.transform((x) { throw error; });
   Expect.isFalse(transformedFuture.isComplete);
   transformedFuture.then((v) => null);
-  Expect.throws(() => completer.complete("42"), check: (e) => e == error);
+  Expect.throws(() => completer.complete("42"), (e) => e == error);
   Expect.equals(error, transformedFuture.exception);
 }
 
@@ -478,7 +478,7 @@
   });
   chainedFuture.then((v) => null);
   Expect.isFalse(chainedFuture.isComplete);
-  Expect.throws(() => completerA.complete("42"), check: (e) => e == error);
+  Expect.throws(() => completerA.complete("42"), (e) => e == error);
   Expect.equals(error, chainedFuture.exception);
 }
 
diff --git a/tests/corelib/list_insert_range_test.dart b/tests/corelib/list_insert_range_test.dart
index b53e395..eebe9b0 100644
--- a/tests/corelib/list_insert_range_test.dart
+++ b/tests/corelib/list_insert_range_test.dart
@@ -10,7 +10,7 @@
   Expect.listEquals([], list);
   list.insertRange(0, 0, 2);
   Expect.listEquals([], list);
-  list.insertRange(0, 0, initialValue: 2);
+  list.insertRange(0, 0, 2);
   Expect.listEquals([], list);
 
   expectIOORE(() { [1, 2].insertRange(-1, 1); });
@@ -20,13 +20,13 @@
   list = []; list.insertRange(0, 3);
   Expect.listEquals([null, null, null], list);
 
-  list = []; list.insertRange(0, 3, initialValue: 1);
+  list = []; list.insertRange(0, 3, 1);
   Expect.listEquals([1, 1, 1], list);
 
-  list = [1, 1]; list.insertRange(1, 1, initialValue: 2);
+  list = [1, 1]; list.insertRange(1, 1, 2);
   Expect.listEquals([1, 2, 1], list);
 
-  list = [1, 1]; list.insertRange(2, 2, initialValue: 9);
+  list = [1, 1]; list.insertRange(2, 2, 9);
   Expect.listEquals([1, 1, 9, 9], list);
 
   list = [1, 1]; list.insertRange(2, 1);
diff --git a/tests/corelib/list_sort_test.dart b/tests/corelib/list_sort_test.dart
index 48e0b0c..8b86765 100644
--- a/tests/corelib/list_sort_test.dart
+++ b/tests/corelib/list_sort_test.dart
@@ -7,10 +7,12 @@
 
 class ListSortTest {
   static void testMain() {
-    var compare = (a, b) => a.compareTo(b);
+    var compare = Comparable.compare;
     var sort = (list) => list.sort(compare);
     new SortHelper(sort, compare).run();
 
+    new SortHelper((list) => list.sort(), compare).run();
+
     compare = (a, b) => -a.compareTo(b);
     new SortHelper(sort, compare).run();
   }
diff --git a/tests/html/async_window_test.dart b/tests/html/async_window_test.dart
index a196472..d3d81c6 100644
--- a/tests/html/async_window_test.dart
+++ b/tests/html/async_window_test.dart
@@ -23,6 +23,6 @@
       // should never be greater than 3.
       assert(counter < 3);
       counter++;
-    }, count:3), 10);
+    }, 3), 10);
   });
 }
diff --git a/tests/html/blob_constructor_test.dart b/tests/html/blob_constructor_test.dart
index b3a633a..788d4d5 100644
--- a/tests/html/blob_constructor_test.dart
+++ b/tests/html/blob_constructor_test.dart
@@ -16,23 +16,27 @@
     });
 
   test('type1', () {
-      var b = new Blob(['Harry'], type: 'text');
+      // OPTIONALS var b = new Blob(['Harry'], type: 'text');
+      var b = new Blob(['Harry'], 'text');
       expect(b.size, 5);
       expect(b.type, 'text');
     });
 
   test('endings1', () {
-      var b = new Blob(['A\nB\n'], endings: 'transparent');
+      // OPTIONALS var b = new Blob(['A\nB\n'], endings: 'transparent');
+      var b = new Blob(['A\nB\n'], null, 'transparent');
       expect(b.size, 4);
     });
 
   test('endings2', () {
-      var b = new Blob(['A\nB\n'], endings: 'native');
+      // OPTIONALS var b = new Blob(['A\nB\n'], endings: 'native');
+      var b = new Blob(['A\nB\n'], null, 'native');
       expect(b.size, (x) => x == 4 || x == 6);
     });
 
   test('twoStrings', () {
-      var b = new Blob(['123', 'xyz'], type: 'text/plain;charset=UTF-8');
+      // OPTIONALS var b = new Blob(['123', 'xyz'], type: 'text/plain;charset=UTF-8');
+      var b = new Blob(['123', 'xyz'], 'text/plain;charset=UTF-8');
       expect(b.size, 6);
     });
 
diff --git a/tests/html/canvas_pixel_array_type_alias_test.dart b/tests/html/canvas_pixel_array_type_alias_test.dart
index b1ac2ad..8ef7565 100644
--- a/tests/html/canvas_pixel_array_type_alias_test.dart
+++ b/tests/html/canvas_pixel_array_type_alias_test.dart
@@ -31,7 +31,8 @@
     Uint8ClampedArray data = image.data;
     // It is legal for the dart2js compiler to believe the type of the native
     // ImageData.data and elides the check, so check the type explicitly:
-    expect(confuseType(data) is Uint8ClampedArray, reason: 'canvas array type');
+    // OPTIONALS expect(confuseType(data) is Uint8ClampedArray, reason: 'canvas array type');
+    expect(confuseType(data) is Uint8ClampedArray, isTrue, 'canvas array type');
 
     expect(data, hasLength(40000));
     checkPixel(data, 0, [0, 0, 0, 0]);
diff --git a/tests/html/fileapi_test.dart b/tests/html/fileapi_test.dart
index 82aad86..f753b01 100644
--- a/tests/html/fileapi_test.dart
+++ b/tests/html/fileapi_test.dart
@@ -25,6 +25,7 @@
   group('getDirectory', () {
 
     test('directoryDoesntExist', () {
+      /* OPTIONALS
       fs.root.getDirectory(
           'directory2',
           options: {},
@@ -34,9 +35,20 @@
           errorCallback: expectAsync1((FileError e) {
             expect(e.code, equals(FileError.NOT_FOUND_ERR));
           }));
+      */
+      fs.root.getDirectory(
+          'directory2',
+          {},
+          (e) {
+            fail('Should not be reached');
+          },
+          expectAsync1((FileError e) {
+            expect(e.code, equals(FileError.NOT_FOUND_ERR));
+          }));
     });
 
     test('directoryCreate', () {
+      /* OPTIONALS
       fs.root.getDirectory(
           'directory3',
           options: {'create': true},
@@ -46,12 +58,23 @@
           errorCallback: (e) {
             fail('Got file error: ${e.code}');
           });
+      */
+      fs.root.getDirectory(
+          'directory3',
+          {'create': true},
+          expectAsync1((DirectoryEntry e) {
+            expect(e.name, equals('directory3'));
+          }),
+          (e) {
+            fail('Got file error: ${e.code}');
+          });
     });
   });
 
   group('getFile', () {
 
     test('fileDoesntExist', () {
+      /* OPTIONALS
       fs.root.getFile(
           'file2',
           options: {},
@@ -61,9 +84,20 @@
           errorCallback: expectAsync1((FileError e) {
             expect(e.code, equals(FileError.NOT_FOUND_ERR));
           }));
+      */
+      fs.root.getFile(
+          'file2',
+          {},
+          (e) {
+            fail('Should not be reached');
+          },
+          expectAsync1((FileError e) {
+            expect(e.code, equals(FileError.NOT_FOUND_ERR));
+          }));
     });
 
     test('fileCreate', () {
+      /* OPTIONALS
       fs.root.getFile(
           'file4',
           options: {'create': true},
@@ -75,5 +109,17 @@
             fail('Got file error: ${e.code}');
           });
       });
+      */
+      fs.root.getFile(
+          'file4',
+          {'create': true},
+          expectAsync1((FileEntry e) {
+            expect(e.name, equals('file4'));
+            expect(e.isFile, equals(true));
+          }),
+          (e) {
+            fail('Got file error: ${e.code}');
+          });
+      });
   });
 }
diff --git a/tests/html/html.status b/tests/html/html.status
index 5a27e4b..a02e9cf 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -2,8 +2,6 @@
 # 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.
 
-xhr_cross_origin_test: Skip # http://dartbug.com/5645
-
 window_open_test: Fail, Pass # http://dartbug.com/5151
 
 event_test: Skip  # Issue 1996
@@ -46,18 +44,18 @@
 [ $compiler == none && $runtime == drt && $system == linux]
 documentfragment_test: Pass, Timeout
 
-[ $runtime == ie || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == opera ]
+[ $runtime == ie9 || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == opera ]
 # TODO(vsm): Triage DOM tests.
 htmloptionscollection_test: Fail # Issue 3813.
 shadow_dom_test: Skip # No ShadowDOM support except on tip dartium.
 shadow_dom_layout_test: Skip
 unknownelement_test: Fail # Issue 4189
 
-[ $runtime == dartium || $runtime == chrome || $runtime == ie || $runtime == safari || $runtime == ff || $runtime == opera ]
+[ $runtime == dartium || $runtime == chrome || $runtime == ie9 || $runtime == safari || $runtime == ff || $runtime == opera ]
 history_test: Fail
 
-[ $runtime == ie ]
-contentelement_test: Fail   # ie does not support content element.
+[ $runtime == ie9 ]
+contentelement_test: Fail   # ie9 does not support content element.
 form_data_test: Fail # Issue 4793.
 form_element_test: Fail # Issue 4793.
 inner_frame_test: Skip # Issue 5727 (timeout)
@@ -110,6 +108,7 @@
 xsltprocessor_test: Skip    # BUG(4016)
 isolates_test: Skip         # BUG(4016)
 xhr_test: Skip              # BUG(4016)
+xhr_cross_origin_test: Fail # Issue 6016.
 
 [ $runtime == safari ]
 performance_api_test: Fail # window.performance.timing not in Safari 6.
@@ -174,7 +173,7 @@
 #    (NS_ERROR_DOM_BAD_URI) ...
 xhr_test: Fail
 
-[ $runtime == ie && ($system == linux || $system == macos) ]
+[ $runtime == ie9 && ($system == linux || $system == macos) ]
 *: Skip
 
 [ $runtime == safari && ($system == linux || $system == windows) ]
@@ -222,9 +221,5 @@
 [ $compiler == dart2js && $runtime == chrome && $system == windows]
 css_test: Pass, Fail # Issue #2823
 
-[ $compiler == dart2js && $runtime == ff && $system == windows]
-js_interop_2_test: Fail # Issue 4658.
-js_interop_3_test: Fail # Issue 4658.
-
 [ $compiler == dart2js && $checked && $browser]
 fileapi_test: Fail # TypeError: Object #<DirectoryEntry> has no method 'get$name'
diff --git a/tests/html/htmloptionscollection_test.dart b/tests/html/htmloptionscollection_test.dart
index d97a594..7f0657e 100644
--- a/tests/html/htmloptionscollection_test.dart
+++ b/tests/html/htmloptionscollection_test.dart
@@ -31,7 +31,8 @@
 
     expect(() { optionsCollection[0] = 1; }, throws);
 
-    optionsCollection[0] = new OptionElement(value: '42', data: 'Option42');
+    // OPTIONALS optionsCollection[0] = new OptionElement(value: '42', data: 'Option42');
+    optionsCollection[0] = new OptionElement('Option42', '42');
     expect(optionsCollection[0].value, equals('42'));
     expect(optionsCollection[0].text, equals('Option42'));
   });
diff --git a/tests/html/indexeddb_4_test.dart b/tests/html/indexeddb_4_test.dart
index 28ddc12..1e7e29c 100644
--- a/tests/html/indexeddb_4_test.dart
+++ b/tests/html/indexeddb_4_test.dart
@@ -122,27 +122,34 @@
   only3() => testRange(new IDBKeyRange.only(-1), null, null);
 
   lower1() => testRange(new IDBKeyRange.lowerBound(40), 40, 99);
-  lower2() => testRange(new IDBKeyRange.lowerBound(40, open: true), 41, 99);
-  lower3() => testRange(new IDBKeyRange.lowerBound(40, open: false), 40, 99);
+  // OPTIONALS lower2() => testRange(new IDBKeyRange.lowerBound(40, open: true), 41, 99);
+  lower2() => testRange(new IDBKeyRange.lowerBound(40, true), 41, 99);
+  // OPTIONALS lower3() => testRange(new IDBKeyRange.lowerBound(40, open: false), 40, 99);
+  lower3() => testRange(new IDBKeyRange.lowerBound(40, false), 40, 99);
 
   upper1() => testRange(new IDBKeyRange.upperBound(40), 0, 40);
-  upper2() => testRange(new IDBKeyRange.upperBound(40, open: true), 0, 39);
-  upper3() => testRange(new IDBKeyRange.upperBound(40, open: false), 0, 40);
+  // OPTIONALS upper2() => testRange(new IDBKeyRange.upperBound(40, open: true), 0, 39);
+  upper2() => testRange(new IDBKeyRange.upperBound(40, true), 0, 39);
+  // upper3() => testRange(new IDBKeyRange.upperBound(40, open: false), 0, 40);
+  upper3() => testRange(new IDBKeyRange.upperBound(40, false), 0, 40);
 
   bound1() => testRange(new IDBKeyRange.bound(20, 30), 20, 30);
 
   bound2() => testRange(new IDBKeyRange.bound(-100, 200), 0, 99);
 
   bound3() =>
-      testRange(new IDBKeyRange.bound(20, 30, upperOpen: true),
+      // OPTIONALS testRange(new IDBKeyRange.bound(20, 30, upperOpen: true),
+      testRange(new IDBKeyRange.bound(20, 30, false, true),
                          20, 29);
 
   bound4() =>
-      testRange(new IDBKeyRange.bound(20, 30, lowerOpen: true),
+      // OPTIONALS testRange(new IDBKeyRange.bound(20, 30, lowerOpen: true),
+      testRange(new IDBKeyRange.bound(20, 30, true),
                          21, 30);
 
   bound5() =>
-      testRange(new IDBKeyRange.bound(20, 30, lowerOpen: true, upperOpen: true),
+      // OPTIONALS testRange(new IDBKeyRange.bound(20, 30, lowerOpen: true, upperOpen: true),
+      testRange(new IDBKeyRange.bound(20, 30, true, true),
                          21, 29);
 
 }
diff --git a/tests/html/mutationobserver_test.dart b/tests/html/mutationobserver_test.dart
index 948d0c6..3585b85 100644
--- a/tests/html/mutationobserver_test.dart
+++ b/tests/html/mutationobserver_test.dart
@@ -49,7 +49,7 @@
         var div2 = new DivElement();
         var mutationObserver = new MutationObserver(
             mutationCallback(2, orderedEquals([div1, div2])));
-        mutationObserver.observe(container, {'childList': true});
+        mutationObserver.observe(container, options: {'childList': true});
 
         container.nodes.add(div1);
         container.nodes.add(div2);
@@ -87,7 +87,7 @@
         var mutationObserver = new MutationObserver(
             mutationCallback(2, orderedEquals([div1, div2])));
         mutationObserver.observe(container,
-                                 {'childList': true, 'subtree': true});
+                                 options: {'childList': true, 'subtree': true});
 
         container.nodes.add(div1);
         div1.nodes.add(div2);
diff --git a/tests/html/node_test.dart b/tests/html/node_test.dart
index 8600072..44bd28e 100644
--- a/tests/html/node_test.dart
+++ b/tests/html/node_test.dart
@@ -27,12 +27,11 @@
     Expect.isTrue(node.nodes[2] is Comment);
   });
 
-  if (false) // TODO(antonm): fix it.
   test('remove', () {
     final node = makeNodeWithChildren();
     final subnode = node.nodes[1];
     final out = subnode.remove();
-    Expect.equals(subnode, out, '#remove should be chainable');
+    Expect.isNull(out);
     Expect.equals(2, node.nodes.length);
     Expect.isTrue(node.nodes[0] is Text);
     Expect.isTrue(node.nodes[1] is Comment);
diff --git a/tests/html/query_test.dart b/tests/html/query_test.dart
index 8339b10..c7e936e 100644
--- a/tests/html/query_test.dart
+++ b/tests/html/query_test.dart
@@ -11,7 +11,7 @@
   useHtmlConfiguration();
 
   final div = new DivElement();
-  final canvas = new CanvasElement(200,200);
+  final canvas = new CanvasElement(width: 200, height: 200);
   canvas.id = 'testcanvas';
   final element =
       new Element.html("<div><br/><img/><input/><img/></div>");
diff --git a/tests/html/queryall_test.dart b/tests/html/queryall_test.dart
index e75ddfb..6b70157 100644
--- a/tests/html/queryall_test.dart
+++ b/tests/html/queryall_test.dart
@@ -47,6 +47,13 @@
       expect(all.length, equals(2));
     });
 
+  test('queryAll-contains', () {
+      List<Element> all = queryAll('*');
+      for (var e in all) {
+        expect(all.contains(e), isTrue);
+      }
+    });
+
   test('queryAll-filter', () {
       List<Element> all = queryAll('*');
       List<CanvasElement> canvases = all.filter((e) => e is CanvasElement);
diff --git a/tests/html/typed_arrays_2_test.dart b/tests/html/typed_arrays_2_test.dart
index f1824a9..6705833f 100644
--- a/tests/html/typed_arrays_2_test.dart
+++ b/tests/html/typed_arrays_2_test.dart
@@ -37,7 +37,8 @@
       Expect.equals(0xCFCECDCC, a2[1]);
       Expect.equals(0x03020100, a2[14]);
 
-      a2 = new Uint32Array.fromBuffer(a1.buffer, length: 30, byteOffset: 456);
+      // OPTIONALS a2 = new Uint32Array.fromBuffer(a1.buffer, length: 30, byteOffset: 456);
+      a2 = new Uint32Array.fromBuffer(a1.buffer, 456, 30);
       Expect.equals(30, a2.length);
       Expect.equals(0xCBCAC9C8, a2[0]);
       Expect.equals(0xCFCECDCC, a2[1]);
@@ -69,7 +70,8 @@
       Expect.equals(0xCFCECDCC, a2[1]);
       Expect.equals(0x03020100, a2[14]);
 
-      a2 = new Uint32Array.fromBuffer(a1.buffer, length: 30, byteOffset: 456);
+      // OPTIONALS a2 = new Uint32Array.fromBuffer(a1.buffer, length: 30, byteOffset: 456);
+      a2 = new Uint32Array.fromBuffer(a1.buffer, 456, 30);
       Expect.equals(30, a2.length);
       Expect.equals(0xCBCAC9C8, a2[0]);
       Expect.equals(0xCFCECDCC, a2[1]);
diff --git a/tests/html/typed_arrays_5_test.dart b/tests/html/typed_arrays_5_test.dart
index daa4ccf..a0792aa 100644
--- a/tests/html/typed_arrays_5_test.dart
+++ b/tests/html/typed_arrays_5_test.dart
@@ -27,4 +27,18 @@
 
       expect(a.filter((x) => x >= 1000).length, equals(24));
   });
+
+  test('contains', () {
+      var a = new Int16Array(1024);
+      for (int i = 0; i < a.length; i++) {
+        a[i] = i;
+      }
+      expect(a.contains(0), isTrue);
+      expect(a.contains(5), isTrue);
+      expect(a.contains(1023), isTrue);
+
+      expect(a.contains(-5), isFalse);
+      expect(a.contains(-1), isFalse);
+      expect(a.contains(1024), isFalse);
+    });
 }
diff --git a/tests/html/typed_arrays_dataview_test.dart b/tests/html/typed_arrays_dataview_test.dart
index 206934d..08029d8 100644
--- a/tests/html/typed_arrays_dataview_test.dart
+++ b/tests/html/typed_arrays_dataview_test.dart
@@ -38,13 +38,17 @@
 
       expect(dv.getInt16(0), equals(1023));
       expect(dv.getInt16(0, false), equals(1023));
-      expect(dv.getInt16(0, littleEndian: false), equals(1023));
+      // OPTIONALS expect(dv.getInt16(0, littleEndian: false), equals(1023));
+      expect(dv.getInt16(0, false), equals(1023));
       expect(dv.getInt16(0, true), equals(-253));
-      expect(dv.getInt16(0, littleEndian: true), equals(-253));
+      // OPTIONALS expect(dv.getInt16(0, littleEndian: true), equals(-253));
+      expect(dv.getInt16(0, true), equals(-253));
 
       expect(dv.getUint16(0), equals(1023));
-      expect(dv.getUint16(0, littleEndian: false), equals(1023));
-      expect(dv.getUint16(0, littleEndian: true), equals(0xFF03));
+      // OPTIONALS expect(dv.getUint16(0, littleEndian: false), equals(1023));
+      expect(dv.getUint16(0, false), equals(1023));
+      // OPTIONALS expect(dv.getUint16(0, littleEndian: true), equals(0xFF03));
+      expect(dv.getUint16(0, true), equals(0xFF03));
 
       dv.setInt16(2, -1);
       expect(dv.getInt16(2), equals(-1));
@@ -58,13 +62,17 @@
 
       expect(dv.getInt32(0), equals(1023));
       expect(dv.getInt32(0, false), equals(1023));
-      expect(dv.getInt32(0, littleEndian: false), equals(1023));
+      // OPTIONALS expect(dv.getInt32(0, littleEndian: false), equals(1023));
+      expect(dv.getInt32(0, false), equals(1023));
       expect(dv.getInt32(0, true), equals(-0xFD0000));
-      expect(dv.getInt32(0, littleEndian: true), equals(-0xFD0000));
+      // OPTIONALS expect(dv.getInt32(0, littleEndian: true), equals(-0xFD0000));
+      expect(dv.getInt32(0, true), equals(-0xFD0000));
 
       expect(dv.getUint32(0), equals(1023));
-      expect(dv.getUint32(0, littleEndian: false), equals(1023));
-      expect(dv.getUint32(0, littleEndian: true), equals(0xFF030000));
+      // OPTIONALS expect(dv.getUint32(0, littleEndian: false), equals(1023));
+      expect(dv.getUint32(0, false), equals(1023));
+      // OPTIONALS expect(dv.getUint32(0, littleEndian: true), equals(0xFF030000));
+      expect(dv.getUint32(0, true), equals(0xFF030000));
   });
 
 }
diff --git a/tests/html/xhr_cross_origin_data.txt b/tests/html/xhr_cross_origin_data.txt
new file mode 100644
index 0000000..5872d96
--- /dev/null
+++ b/tests/html/xhr_cross_origin_data.txt
@@ -0,0 +1 @@
+{"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearch/1.1/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$issues":"http://schemas.google.com/projecthosting/issues/2009","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full"},"updated":{"$t":"2012-10-17T19:55:25.326Z"},"title":{"$t":"Issues - dart"},"subtitle":{"$t":"Issues - dart"},"link":[{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/list"},{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full"},{"rel":"http://schemas.google.com/g/2005#post","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full?alt=json&max-results=25"},{"rel":"next","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full?alt=json&start-index=26&max-results=25"}],"generator":{"$t":"ProjectHosting","version":"1.0","uri":"http://code.google.com/feeds/issues"},"openSearch$totalResults":{"$t":6004},"openSearch$startIndex":{"$t":1},"openSearch$itemsPerPage":{"$t":25},"entry":[{"gd$etag":"W/\"CE8DRX47eCl7ImA9WhdaEEw.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/1"},"published":{"$t":"2011-10-06T15:11:23.000Z"},"updated":{"$t":"2011-10-19T08:27:54.000Z"},"title":{"$t":"Process tests sometimes cause timeout on Linux"},"content":{"$t":"Either of the process tests\r\n\r\n  ProcessExitTest.dart\r\n  ProcessSegfaultTest.dart\r\n  ProcessStartExceptionTest.dart\r\n  ProcessStderrTest.dart\r\n  ProcessStdoutTest.dart\r\n\r\ncan hang on Linux. It happens once every ~25 runs.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/1/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=1"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/1"}],"author":[{"name":{"$t":"sgjesse@google.com"},"uri":{"$t":"/u/sgjesse@google.com/"}}],"issues$cc":[{"issues$uri":{"$t":"/u/100337825224881731112/"},"issues$username":{"$t":"fmal...@google.com"}}],"issues$closedDate":{"$t":"2011-10-19T08:27:54.000Z"},"issues$id":{"$t":1},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$owner":{"issues$uri":{"$t":"/u/sgjesse@google.com/"},"issues$username":{"$t":"sgjesse@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"DUUAQH47eCl7ImA9WhdUGUU.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/2"},"published":{"$t":"2011-10-07T07:53:55.000Z"},"updated":{"$t":"2011-10-07T11:34:01.000Z"},"title":{"$t":"EchoServer tests occasionally crash on Windows"},"content":{"$t":"The EchoServer tests occasionally hits what should be an unreachable path.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/2/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=2"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/2"}],"author":[{"name":{"$t":"ager@google.com"},"uri":{"$t":"/u/ager@google.com/"}}],"issues$cc":[{"issues$uri":{"$t":"/u/sgjesse@google.com/"},"issues$username":{"$t":"sgjesse@google.com"}}],"issues$closedDate":{"$t":"2011-10-07T11:34:01.000Z"},"issues$id":{"$t":2},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-High"},{"$t":"OpSys-Windows"}],"issues$owner":{"issues$uri":{"$t":"/u/ager@google.com/"},"issues$username":{"$t":"ager@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"DUYMQH47eCl7ImA9WhdbFE8.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/3"},"published":{"$t":"2011-10-10T10:34:32.000Z"},"updated":{"$t":"2011-10-12T13:46:21.000Z"},"title":{"$t":"Dart_Snapshot conflicting uses"},"content":{"$t":"Trying to build Dart after clean checkout from SVN gives me :\r\n\r\nruntime/vm/dart_api_impl.cc: In function ‘void* dart::Dart_CreateIsolate(void*, void*)’:\r\nruntime/vm/dart_api_impl.cc:38:71: error: declaration of ‘void* dart::Dart_CreateIsolate(void*, void*)’ with C language linkage\r\nruntime/include/dart_api.h:185:26: error: conflicts with previous declaration ‘void* Dart_CreateIsolate(const Dart_Snapshot*, void*)’\r\n\r\nI ended up changing the dart_api_impl.cc declaration to use const Dart_Snapshot* and did a cast to (void*) in order to call Dart::CreateIsolate((void*)snapshot, data);","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/3/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=3"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/3"}],"author":[{"name":{"$t":"nelson.s...@gmail.com"},"uri":{"$t":"/u/114313790760784276282/"}}],"issues$closedDate":{"$t":"2011-10-11T15:43:38.000Z"},"issues$id":{"$t":3},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$owner":{"issues$uri":{"$t":"/u/asiva@google.com/"},"issues$username":{"$t":"asiva@google.com"}},"issues$stars":{"$t":13},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"Dk4MRn47eCl7ImA9WhdbEkk.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/4"},"published":{"$t":"2011-10-10T10:44:36.000Z"},"updated":{"$t":"2011-10-10T11:09:47.000Z"},"title":{"$t":"Not-implemented iteration for objects"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n\r\n  main() {\r\n    var obj = {&quot;a&quot;: 1, &quot;b&quot;: 2};\r\n    for (var key in obj) {\r\n      print(key);\r\n    }\r\n  }\r\nhttp://try-dart-lang.appspot.com/s/EmEO\r\n\r\nWhat is the expected output?\r\na\r\nb\r\n\r\nWhat do you see instead?\r\nNoSuchMethodException - receiver: '' function name: 'iterator$named' arguments: []]\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\nOnline dart compiler.\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\n\r\nIn the specification it says that &quot;for in&quot; construct is desugared into var n0 = e.iterator(); while (n0.hasNext()) { finalVarOrType id = n0.next();\r\nIt is not working because obj.iterator does not exist.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/4/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=4"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/4"}],"author":[{"name":{"$t":"vjeuxx"},"uri":{"$t":"/u/vjeuxx/"}}],"issues$closedDate":{"$t":"2011-10-10T11:09:47.000Z"},"issues$id":{"$t":4},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Invalid"}},{"gd$etag":"W/\"AkIGQH47eCl7ImA9WhdbEks.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/5"},"published":{"$t":"2011-10-10T11:03:05.000Z"},"updated":{"$t":"2011-10-10T17:42:01.000Z"},"title":{"$t":"Variables in single/double quotes."},"content":{"$t":"Can we use the PHP view that single quotes don't contain variables, but double quotes do... this may help the parser in speed, but more importantly it means the programmer doesn't have to check for and escape variables in single quoted strings.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/5/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=5"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/5"}],"author":[{"name":{"$t":"cr...@craigfrancis.co.uk"},"uri":{"$t":"/u/105349735893558381122/"}}],"issues$closedDate":{"$t":"2011-10-10T17:42:01.000Z"},"issues$id":{"$t":5},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$stars":{"$t":3},"issues$state":{"$t":"closed"},"issues$status":{"$t":"WontFix"}},{"gd$etag":"W/\"DEIGQX47eCl7ImA9WhRTEUg.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/6"},"published":{"$t":"2011-10-10T11:38:13.000Z"},"updated":{"$t":"2011-11-01T14:08:40.000Z"},"title":{"$t":"Type checking is broken"},"content":{"$t":"Use dartc_test to run:\r\n\r\nbool foo(bool bar()) =&gt; bar();\r\n\r\nbool bar() {}\r\n\r\nmain() {\r\n  foo(bar);\r\n}\r\n\r\nwith --enable_type_checks.\r\n\r\nAn error is thrown because the type of bar is not bool.\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/6/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=6"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/6"}],"author":[{"name":{"$t":"benl@google.com"},"uri":{"$t":"/u/benl@google.com/"}}],"issues$closedDate":{"$t":"2011-11-01T14:08:40.000Z"},"issues$id":{"$t":6},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Area-Compiler"}],"issues$owner":{"issues$uri":{"$t":"/u/jat@google.com/"},"issues$username":{"$t":"jat@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"DEEAQH47eCl7ImA9WhdbFE8.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/7"},"published":{"$t":"2011-10-10T12:32:40.000Z"},"updated":{"$t":"2011-10-12T13:37:21.000Z"},"title":{"$t":"declaredIndentifier typos in Dart Language Specification, Draft Version 0.01, October 10th, 2011"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. Open http://www.dartlang.org/docs/spec/dartLangSpec.pdf\r\n2. Search for &quot;indent&quot; (without the quotes)\r\n3. Notice how this should rather read ident instead.\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\n\r\nI see what must be a typo.\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\n\r\nDart Programming Language Specification\r\nDraft Version 0.01\r\nThe Dart Team\r\nOctober 10th, 2011\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\n\r\nHere is a copy/paste from the pdf (with the fi ligature manually reapaired). See my (sic) annotations for where I think the typos are:\r\n\r\n11.9\r\n\r\nTry\r\n\r\nThe try statement supports the definition of exception handling code in a struc-\r\ntured way.\r\n\r\ntryStatement:\r\ntry block (catchPart+ finallyPart? | finallyPart)\r\n;\r\n\r\ncatchPart:\r\ncatch ‘(’ declaredIndentifier (sic) (‘, ’ declaredIndentifier (sic))? ‘)’ block\r\n;\r\n\r\nfinallyPart:\r\nfinally block\r\n;\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/7/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=7"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/7"}],"author":[{"name":{"$t":"adrian.a...@gmail.com"},"uri":{"$t":"/u/114973624116584041537/"}}],"issues$closedDate":{"$t":"2011-10-12T13:37:21.000Z"},"issues$id":{"$t":7},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Component-Docs"}],"issues$owner":{"issues$uri":{"$t":"/u/102708310591662789853/"},"issues$username":{"$t":"gbra...@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Done"}},{"gd$etag":"W/\"D0QNQ347eCl7ImA9WhdbEkg.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/8"},"published":{"$t":"2011-10-10T12:46:09.000Z"},"updated":{"$t":"2011-10-10T14:03:12.000Z"},"title":{"$t":"Build Failure for standalone VM"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n&gt; Follow steps to build VM mentioned at http://code.google.com/p/dart/wiki/Building#Building_the_standalone_VM\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\nBuild should be success, but it fails.\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\nLatest version.\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\n\r\nError output:\r\n~/dart/runtime$ ../tools/build.py --arch=ia32\r\nmake -j 1 BUILDTYPE=Debug_ia32 all\r\n  CXX(target) out/Debug_ia32/obj.target/libdart/runtime/vm/dart_api_impl.o\r\ncc1plus: warnings being treated as errors\r\n../runtime/vm/dart_api_impl.cc: In function ‘void* dart::Dart_CreateIsolate(void*, void*)’:\r\n../runtime/vm/dart_api_impl.cc:38:71: error: declaration of ‘void* dart::Dart_CreateIsolate(void*, void*)’ with C language linkage\r\n../runtime/include/dart_api.h:185:26: error: conflicts with previous declaration ‘void* Dart_CreateIsolate(const Dart_Snapshot*, void*)’\r\nmake: *** [out/Debug_ia32/obj.target/libdart/runtime/vm/dart_api_impl.o] Error 1\r\nBUILD FAILED\r\n\r\n\r\nIs this a known issue? or am I doing something wrong?\r\n\r\nthanks,\r\nswarup","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/8/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=8"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/8"}],"author":[{"name":{"$t":"me.s...@gmail.com"},"uri":{"$t":"/u/112564033093352645938/"}}],"issues$closedDate":{"$t":"2011-10-10T14:03:12.000Z"},"issues$id":{"$t":8},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$mergedInto":{"issues$id":{"$t":3},"issues$project":{"$t":"dart"}},"issues$stars":{"$t":2},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Duplicate"}},{"gd$etag":"W/\"CEMMQH47eCl7ImA9WhdbE0g.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/9"},"published":{"$t":"2011-10-10T13:08:33.000Z"},"updated":{"$t":"2011-10-11T17:01:21.000Z"},"title":{"$t":"\"variable set but not used\" error during build of VM"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. &gt; Follow steps to build VM mentioned at http://code.google.com/p/dart/wiki/Building#Building_the_standalone_VM\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\nI get some &quot;variable X set but not used&quot;-type warnings, that -Werror escalates to errors, halting the build.\r\nAs a temporary measure, I removed -Werror from all *.mk files, which allows me to build the standalone VM successfully.\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\nRecent svn on arch linux using gcc version 4.6.1 20110819 (prerelease) \r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\nHere is a full list of the warnings (without -Werror and therefor not turned to errors)\r\n\r\n\r\nthird_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator::VisitCompareOperation(v8::internal::CompareOperation*)’:\r\nthird_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: warning: variable ‘strict’ set but not used [-Wunused-but-set-variable]\r\n  CXX(host) out/Debug_ia32/obj.host/v8_base/third_party/v8/src/ia32/lithium-gap-resolver-ia32.o\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoLoadKeyedFastDoubleElement(v8::internal::LLoadKeyedFastDoubleElement*)’:\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc:2235:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoStoreKeyedFastDoubleElement(v8::internal::LStoreKeyedFastDoubleElement*)’:\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc:3100:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc:3101:12: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]\r\n\r\n\r\nthird_party/v8/src/ia32/full-codegen-ia32.cc: In member function ‘virtual void v8::internal::FullCodeGenerator::VisitCompareOperation(v8::internal::CompareOperation*)’:\r\nthird_party/v8/src/ia32/full-codegen-ia32.cc:4085:12: warning: variable ‘strict’ set but not used [-Wunused-but-set-variable]\r\n  CXX(target) out/Debug_ia32/obj.target/v8_base/third_party/v8/src/ia32/lithium-gap-resolver-ia32.o\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoLoadKeyedFastDoubleElement(v8::internal::LLoadKeyedFastDoubleElement*)’:\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc:2235:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc: In member function ‘void v8::internal::LCodeGen::DoStoreKeyedFastDoubleElement(v8::internal::LStoreKeyedFastDoubleElement*)’:\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc:3100:12: warning: variable ‘elements’ set but not used [-Wunused-but-set-variable]\r\nthird_party/v8/src/ia32/lithium-codegen-ia32.cc:3101:12: warning: variable ‘key’ set but not used [-Wunused-but-set-variable]\r\n\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/9/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=9"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/9"}],"author":[{"name":{"$t":"waq...@gmail.com"},"uri":{"$t":"/u/110067472520212772478/"}}],"issues$closedDate":{"$t":"2011-10-10T13:20:54.000Z"},"issues$id":{"$t":9},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$mergedInto":{"issues$id":{"$t":43},"issues$project":{"$t":"dart"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Duplicate"}},{"gd$etag":"W/\"DE4GRX47eCl7ImA9WhdbGEo.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/10"},"published":{"$t":"2011-10-10T13:21:56.000Z"},"updated":{"$t":"2011-10-17T18:42:04.000Z"},"title":{"$t":"dartc build failure: private DartNode.setParent()"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. build dart compiler\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\ndart/compiler/java/com/google/dart/compiler/ast/DartNode.java fails to compile with the following error:\r\n    [javac] /data/down/devel/dart/dart/compiler/java/com/google/dart/compiler/ast/DartNode.java:122: error: setParent(DartNode) has private access in DartNode\r\n    [javac]        child.setParent(this);\r\n    [javac]             ^\r\n\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\ndart svn, javac 1.7.0 on arch linux\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\nMaking setParent() protected instead of private fixes the issue for me, allowing it to be called from protected method becomeParentOf() of the same class.\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/10/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=10"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/10"}],"author":[{"name":{"$t":"waq...@gmail.com"},"uri":{"$t":"/u/110067472520212772478/"}}],"issues$closedDate":{"$t":"2011-10-17T18:42:04.000Z"},"issues$id":{"$t":10},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Area-Compiler"}],"issues$owner":{"issues$uri":{"$t":"/u/116010686905328984286/"},"issues$username":{"$t":"johnl...@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"D0MCRH47eCl7ImA9WhdbEks.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/11"},"published":{"$t":"2011-10-10T14:07:17.000Z"},"updated":{"$t":"2011-10-10T16:51:05.000Z"},"title":{"$t":"Error in first online tutorial"},"content":{"$t":"\r\n1. Enter any 3 russian symbols instead of &quot;World&quot;\r\n2. Run.\r\n3. Program prints &quot;Hello, хуй!&quot;\r\n\r\nхуй - russian dirty word. Do you have russian programmers? ;)\r\n\r\nI'm using google chrome 14 to try this tutorial.\r\nIn some cases (when number of russian symbols is more then 3) it prints squares instead of letters (it's encoding problems i think ;)\r\n\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/11/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=11"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/11"}],"author":[{"name":{"$t":"podg...@gmail.com"},"uri":{"$t":"/u/105898658743680019064/"}}],"issues$closedDate":{"$t":"2011-10-10T16:51:05.000Z"},"issues$id":{"$t":11},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$owner":{"issues$uri":{"$t":"/u/100337825224881731112/"},"issues$username":{"$t":"fmal...@google.com"}},"issues$stars":{"$t":2},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"A0UBSH47eCl7ImA9WhdbE04.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/12"},"published":{"$t":"2011-10-10T14:28:03.000Z"},"updated":{"$t":"2011-10-11T13:20:59.000Z"},"title":{"$t":"compiler should be be independant of browser code"},"content":{"$t":"Request: Make the Dart-&gt;JS compiler as a seperate file from the browser checking code so that the project can be included in other projects such as Node.JS\r\n\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/12/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=12"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/12"}],"author":[{"name":{"$t":"xdr...@gmail.com"},"uri":{"$t":"/u/117476521218063886204/"}}],"issues$closedDate":{"$t":"2011-10-11T13:20:59.000Z"},"issues$id":{"$t":12},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$stars":{"$t":3},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Invalid"}},{"gd$etag":"W/\"CkEHQ347eCl7ImA9WhJSEkk.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/13"},"published":{"$t":"2011-10-10T14:33:33.000Z"},"updated":{"$t":"2012-07-02T14:50:32.000Z"},"title":{"$t":"Add C#-style extension methods"},"content":{"$t":"Unless I'm reading the spec and examples wrong, it looks as if Dart uses the horrific Java approach of providing utility methods that operate on a interface, by putting them as static methods within some class with a name like 'Arrays' or 'Collections'. This is nonsense, especially when Linq and extension methods in C# have demonstrated a far superior approach, and Dart should provide an equivalent mechanism.\r\n\r\nAn obvious, easy way to add this would be that top level functions can optionally be called on an object using the dot operator, in which case the calling instance is passed as the first function parameter.\r\n\r\nE.g. to write a generic first method that operates over an iterator for a supplied predicate:\r\n\r\nT first&lt;T&gt;(Iterator&lt;T&gt; iterator, bool predicate(T obj)) {\r\n    while (iterator.hasNext()) {\r\n        if (predicate(iterator.next()) {\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\nThis could be called on an instance of an iterator as follows:\r\n\r\nvar jon = peopleIterator.first((p) =&gt; p.name == 'Jon');\r\n\r\nUsing extension methods that also return iterators, they can then chained together to form fluent expressions:\r\n\r\nvar fiveOldestJons = peopleInterator.where((p) =&gt; p.name == 'Jon').orderBy((p) =&gt; p.age).take(5);\r\n\r\nIt's worrying looking through the language design that you don't seem to looked much beyond JavaScript and Java for your inspiration in Dart. I can't speak for users of other languages, but I strongly doubt C# developers will be particularly impressed by a lot of the Java style anachronisms, and I'd urge you to cast your net a little more widely in general.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/13/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=13"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/13"}],"author":[{"name":{"$t":"jon.rimmer"},"uri":{"$t":"/u/jon.rimmer/"}}],"issues$closedDate":{"$t":"2011-10-12T13:44:38.000Z"},"issues$id":{"$t":13},"issues$label":[{"$t":"Type-Enhancement"},{"$t":"Priority-Medium"},{"$t":"Area-Language"}],"issues$stars":{"$t":25},"issues$state":{"$t":"closed"},"issues$status":{"$t":"WontFix"}},{"gd$etag":"W/\"Ck4BRn47eCl7ImA9WhRaF04.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/14"},"published":{"$t":"2011-10-10T15:34:16.000Z"},"updated":{"$t":"2012-02-20T09:42:37.000Z"},"title":{"$t":"Add Tau constant to core Math class"},"content":{"$t":"With a new language, we are taking the opportunity to introduce better concepts, right? So please add Tau, the ratio of a circle's circumference to its radius (i.e. 2pi), to the Math class.\r\n\r\nLeave Math.PI as is, but please add Math.TAU\r\n\r\nThis is a safe addition with no side effects and minimal impact to the language and runtime.\r\n\r\nTau manifesto: http://tauday.com/\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/14/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=14"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/14"}],"author":[{"name":{"$t":"peter.ge...@gmail.com"},"uri":{"$t":"/u/116327704440122793403/"}}],"issues$closedDate":{"$t":"2012-02-16T00:26:22.000Z"},"issues$id":{"$t":14},"issues$label":[{"$t":"Type-Enhancement"},{"$t":"Priority-Medium"},{"$t":"Area-Library"}],"issues$owner":{"issues$uri":{"$t":"/u/jjb@google.com/"},"issues$username":{"$t":"jjb@google.com"}},"issues$stars":{"$t":17},"issues$state":{"$t":"closed"},"issues$status":{"$t":"WontFix"}},{"gd$etag":"W/\"DE8BQH47eCl7ImA9WhdaEkw.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/15"},"published":{"$t":"2011-10-10T15:36:24.000Z"},"updated":{"$t":"2011-10-21T17:07:31.000Z"},"title":{"$t":"jQuery integration"},"content":{"$t":"I may be mis-understanding dart, but I would like to put in a request that Google's engineers/someone smarter than me add jQuery as a possible library.\r\n\r\nFor instance, how would I accomplish the following using dart?\r\n\r\n&lt;pre&gt;\r\n$(&quot;p&quot;).click({function(){ alert(&quot;You clicked a paragraph tag!&quot;); });\r\n&lt;/pre&gt;\r\n\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/15/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=15"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/15"}],"author":[{"name":{"$t":"bri...@dearing-group.com"},"uri":{"$t":"/u/108006530617416183710/"}}],"issues$closedDate":{"$t":"2011-10-21T16:26:31.000Z"},"issues$id":{"$t":15},"issues$label":[{"$t":"Type-Enhancement"},{"$t":"Priority-Medium"},{"$t":"Area-UI"}],"issues$stars":{"$t":10},"issues$state":{"$t":"closed"},"issues$status":{"$t":"WontFix"}},{"gd$etag":"W/\"CUQNQ347eCl7ImA9WhdbE0g.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/16"},"published":{"$t":"2011-10-10T16:04:28.000Z"},"updated":{"$t":"2011-10-11T17:16:32.000Z"},"title":{"$t":"Generics disappear on try.dartlang.org"},"content":{"$t":"Go to try.dartlang.org, then insert and execute this code:\r\nclass PointlessValueWrapper {\r\n  PointlessValueWrapper(Type pointlessArgument);\r\n}\r\nmain() {\r\n  new PointlessValueWrapper(5);\r\n  new PointlessValueWrapper(&quot;Hello!&quot;);\r\n}\r\n\r\nAs expected, line 6 raises a warning.\r\n\r\nNow, open the link on the top right in a new tab. You'll see the same code, except the type parameters are missing. Because of this, line 2 now produces an error.\r\n\r\nI expect a tokeniser somewhere is misbehaving.\r\n\r\nUsing Firefox/Nightly (which is at version 10, at the moment).","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/16/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=16"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/16"}],"author":[{"name":{"$t":"pimmhoge...@gmail.com"},"uri":{"$t":"/u/117820825527967972339/"}}],"issues$closedDate":{"$t":"2011-10-11T17:16:32.000Z"},"issues$id":{"$t":16},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Area-Dartboard"}],"issues$owner":{"issues$uri":{"$t":"/u/103267283189406017873/"},"issues$username":{"$t":"knor...@google.com"}},"issues$stars":{"$t":0},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Verified"}},{"gd$etag":"W/\"D0UDRH47eCl7ImA9WhdbEks.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/17"},"published":{"$t":"2011-10-10T16:11:37.000Z"},"updated":{"$t":"2011-10-10T16:47:55.000Z"},"title":{"$t":"Can't build editor"},"content":{"$t":"In editor/build/README.txt:\r\n\r\n---\r\nTo begin, make sure the Dart plugin and feature sources are checked out from\r\nSVN. Edit rcpinit.sh to define the location of the TRUNK directory that was\r\nchecked out. Also checkout the usage profile plugin and feature from perforce.\r\nDefine that directory in rcpinit.sh as GDT_PROF. You only the the usage\r\nprofiler, not all of GPE.\r\n---\r\n\r\nBut google plugin for eclipse is not open-sourced yet:\r\nhttp://code.google.com/eclipse/docs/faq.html#source\r\n\r\nWhere can I find smth like /src/prof-git5/google3/third_party/java/google_plugin_eclipse/opensource/trunk\r\nfor building editor?","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/17/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=17"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/17"}],"author":[{"name":{"$t":"bats...@gmail.com"},"uri":{"$t":"/u/108382165757819799147/"}}],"issues$closedDate":{"$t":"2011-10-10T16:23:46.000Z"},"issues$id":{"$t":17},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Done"}},{"gd$etag":"W/\"CEYMRn47eCl7ImA9WhJbFU0.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/18"},"published":{"$t":"2011-10-10T16:31:10.000Z"},"updated":{"$t":"2012-09-24T15:56:27.000Z"},"title":{"$t":"Building dart on Mac OS X Lion with xcode 4"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. checkout source code\r\n2. run tools/build.py\r\n\r\nResult:\r\n=== BUILD NATIVE TARGET v8_base OF PROJECT v8 WITH CONFIGURATION Debug_x64 ===\r\n** BUILD FAILED **\r\n\r\nThe problem is in macosx sdk version. Google Dart needs 10.5 for building, but there are no macosx10.5 sdk in XCode 4 in Lion.\r\n\r\nWorkaround: specify sdk manually in build.py:\r\nIndex: tools/build.py\r\n===================================================================\r\n--- tools/build.py  (revision 296)\r\n+++ tools/build.py  (working copy)\r\n@@ -106,6 +106,8 @@\r\n         if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):\r\n           project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName()\r\n         args = ['xcodebuild',\r\n+                '-sdk',\r\n+                'macosx10.6',\r\n                 '-project',\r\n                 project_file,\r\n                 '-target',\r\n\r\nFull instruction for workaround on Lion:\r\nhttp://batsuev.com/2011/10/building-google-dart-on-os-x-lion-with-xcode-4/\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/18/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=18"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/18"}],"author":[{"name":{"$t":"bats...@gmail.com"},"uri":{"$t":"/u/108382165757819799147/"}}],"issues$cc":[{"issues$uri":{"$t":"/u/efortuna@google.com/"},"issues$username":{"$t":"efortuna@google.com"}},{"issues$uri":{"$t":"/u/dgrove@google.com/"},"issues$username":{"$t":"dgrove@google.com"}}],"issues$id":{"$t":18},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Area-Build"},{"$t":"Milestone-M2"}],"issues$owner":{"issues$uri":{"$t":"/u/iposva@google.com/"},"issues$username":{"$t":"iposva@google.com"}},"issues$stars":{"$t":22},"issues$state":{"$t":"open"},"issues$status":{"$t":"Accepted"}},{"gd$etag":"W/\"D0EBSH47eCl7ImA9WhdbEko.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/19"},"published":{"$t":"2011-10-10T17:36:20.000Z"},"updated":{"$t":"2011-10-10T19:40:59.000Z"},"title":{"$t":"Integration with Eclipse"},"content":{"$t":"There should be a good integration towards common IDE's like Eclipse. ","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/19/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=19"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/19"}],"author":[{"name":{"$t":"ad...@trollweb.no"},"uri":{"$t":"/u/108751899022404107859/"}}],"issues$closedDate":{"$t":"2011-10-10T19:40:59.000Z"},"issues$id":{"$t":19},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$stars":{"$t":0},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Invalid"}},{"gd$etag":"W/\"DE4BRX47eCl7ImA9WhdbE0k.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/20"},"published":{"$t":"2011-10-10T17:48:37.000Z"},"updated":{"$t":"2011-10-11T15:29:14.000Z"},"title":{"$t":"typo in initial example on try-dart-lang.appspot.com"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. Visit http://try-dart-lang.appspot.com/\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\n\r\nI expected to see coherent wording. Instead, I see &quot;When you run the code … it it submitted to AppEngine&quot;. I believe the intended wording was &quot;When you run the code, it is submitted to AppEngine&quot;.\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\n\r\nThe live version on Chrome and Fedora.\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\n\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/20/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=20"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/20"}],"author":[{"name":{"$t":"mich...@ficarra.me"},"uri":{"$t":"/u/111990041337538184628/"}}],"issues$closedDate":{"$t":"2011-10-11T14:01:40.000Z"},"issues$id":{"$t":20},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Component-Docs"}],"issues$owner":{"issues$uri":{"$t":"/u/pdr@google.com/"},"issues$username":{"$t":"pdr@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"Ck8AQH47eCl7ImA9WhdbE0k.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/21"},"published":{"$t":"2011-10-10T17:55:20.000Z"},"updated":{"$t":"2011-10-11T13:47:21.000Z"},"title":{"$t":"Include Open Sans Bold web font in dartlang.org pages"},"content":{"$t":"The pages on dartlang.org use this tag to load Open Sans:\r\n\r\n&lt;link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'&gt;\r\n\r\nThis doesn't load the boldface file, while some parts like .intro &gt; dl &gt; dt are set in boldface. Currently this means that the regular font is made bold programmatically at these places, which looks very bad.\r\n\r\nInstead, please use this tag:\r\n\r\n&lt;link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'&gt;","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/21/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=21"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/21"}],"author":[{"name":{"$t":"sander.d...@gmail.com"},"uri":{"$t":"/u/117653750014788020856/"}}],"issues$closedDate":{"$t":"2011-10-11T13:47:21.000Z"},"issues$id":{"$t":21},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Component-Docs"}],"issues$owner":{"issues$uri":{"$t":"/u/drfibonacci@google.com/"},"issues$username":{"$t":"drfibonacci@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}},{"gd$etag":"W/\"CE4DR347eCl7ImA9WhJaEko.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/22"},"published":{"$t":"2011-10-10T18:47:48.000Z"},"updated":{"$t":"2012-10-03T14:02:56.000Z"},"title":{"$t":"Support non-nullable types."},"content":{"$t":"Short version: Null pointers are a really good way to mess up a program at runtime, and I'd like the Dart team to reevaluate whether they're absolutely required.\r\n\r\nSlightly longer version: I would say the #1 cause of issues in my programs (excluding logical errors/requirements errors) are NPEs. Having a language support NPE removal, be it via some clever compiler warning or simply removing null altogether, would be wonderful. I'm personally partial to Scala's method of null removal, but I'm sure PL gurus like yourselves have seen many others.\r\n\r\nDart has a stated goal of avoiding the creation of programs that &quot;are difficult to debug or maintain.&quot; NPEs are a huge pain point in this regard. I'd be really happy if the Dart team reevaluated whether they are absolutely required to achieve the other aims.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/22/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=22"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/22"}],"author":[{"name":{"$t":"cfle...@gmail.com"},"uri":{"$t":"/u/117457048271408990845/"}}],"issues$id":{"$t":22},"issues$label":[{"$t":"Type-Enhancement"},{"$t":"Priority-Medium"},{"$t":"Area-Language"},{"$t":"Milestone-Later"}],"issues$owner":{"issues$uri":{"$t":"/u/102708310591662789853/"},"issues$username":{"$t":"gbra...@google.com"}},"issues$stars":{"$t":110},"issues$state":{"$t":"open"},"issues$status":{"$t":"Triaged"}},{"gd$etag":"W/\"A0YNSH47eCl7ImA9WhdbE04.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/23"},"published":{"$t":"2011-10-10T19:00:32.000Z"},"updated":{"$t":"2011-10-11T13:19:59.000Z"},"title":{"$t":"The example Fibonacci is not responsive most of the times"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. At dartland.org, choose the example Fibonacci.\r\n2. Instead of 20, as a parameter for the function Fib, use 50.\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\nI was expecting a numeric output generated by the function. Instead, the page freezes or crashes.\r\n\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\nn/a. Google Chrome on Windows 7\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\n\r\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/23/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=23"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/23"}],"author":[{"name":{"$t":"guilherm...@gmail.com"},"uri":{"$t":"/u/117803371227799387793/"}}],"issues$closedDate":{"$t":"2011-10-11T13:19:59.000Z"},"issues$id":{"$t":23},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$stars":{"$t":0},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Invalid"}},{"gd$etag":"W/\"CU8BSH47eCl7ImA9WhdbEko.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/24"},"published":{"$t":"2011-10-10T19:01:19.000Z"},"updated":{"$t":"2011-10-10T19:10:59.000Z"},"title":{"$t":"Allowing null pointers is undesirable"},"content":{"$t":"Short version: Null pointers are a really good way to mess up a program at runtime, and I'd like the Dart team to reevaluate whether they're absolutely required.\r\n\r\nSlightly longer version: I would say the #1 cause of issues in my programs (excluding logical errors/requirements errors) are NPEs. Having a language support NPE removal, be it via some clever compiler warning or simply removing null altogether, would be wonderful. I'm personally partial to Scala's method of null removal, but I'm sure PL gurus like yourselves have seen many others.\r\n\r\nDart has a stated goal of avoiding the creation of programs that &quot;are difficult to debug or maintain.&quot; NPEs are a huge pain point in this regard. I'd be really happy if the Dart team reevaluated whether they are absolutely required to achieve the other aims.","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/24/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=24"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/24"}],"author":[{"name":{"$t":"cfle...@gmail.com"},"uri":{"$t":"/u/117457048271408990845/"}}],"issues$closedDate":{"$t":"2011-10-10T19:10:59.000Z"},"issues$id":{"$t":24},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"}],"issues$mergedInto":{"issues$id":{"$t":22},"issues$project":{"$t":"dart"}},"issues$stars":{"$t":2},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Duplicate"}},{"gd$etag":"W/\"C0EBRX47eCl7ImA9WhdbE0k.\"","id":{"$t":"http://code.google.com/feeds/issues/p/dart/issues/full/25"},"published":{"$t":"2011-10-10T19:50:14.000Z"},"updated":{"$t":"2011-10-11T14:00:54.000Z"},"title":{"$t":"Another typo in http://try-dart-lang.appspot.com/ code comments"},"content":{"$t":"\u003cb\u003eWhat steps will reproduce the problem?\u003c/b\u003e\n1. Visit http://try-dart-lang.appspot.com/\r\n\r\n\u003cb\u003eWhat is the expected output? What do you see instead?\u003c/b\u003e\n\r\nIn addition to issue20, I spotted another typo, marked with (sic) below.\r\n\r\nThe first or second &quot;of&quot; can be deleted, whichever you prefer :-)\r\n\r\n&quot;// Here you can try out the Dart Language from the comfort of of (sic) your own&quot;\r\n\r\n\u003cb\u003eWhat version of the product are you using? On what operating system?\u003c/b\u003e\n\r\nAbove URL at the time of this issue submission.\r\n\r\n\u003cb\u003ePlease provide any additional information below.\u003c/b\u003e\n","type":"html"},"link":[{"rel":"replies","type":"application/atom+xml","href":"http://code.google.com/feeds/issues/p/dart/issues/25/comments/full"},{"rel":"alternate","type":"text/html","href":"http://code.google.com/p/dart/issues/detail?id=25"},{"rel":"self","type":"application/atom+xml","href":"https://code.google.com/feeds/issues/p/dart/issues/full/25"}],"author":[{"name":{"$t":"adrian.a...@gmail.com"},"uri":{"$t":"/u/114973624116584041537/"}}],"issues$closedDate":{"$t":"2011-10-11T14:00:54.000Z"},"issues$id":{"$t":25},"issues$label":[{"$t":"Type-Defect"},{"$t":"Priority-Medium"},{"$t":"Component-Docs"}],"issues$owner":{"issues$uri":{"$t":"/u/pdr@google.com/"},"issues$username":{"$t":"pdr@google.com"}},"issues$stars":{"$t":1},"issues$state":{"$t":"closed"},"issues$status":{"$t":"Fixed"}}]}}
diff --git a/tests/html/xhr_cross_origin_test.dart b/tests/html/xhr_cross_origin_test.dart
index 5b83c29..472950c 100644
--- a/tests/html/xhr_cross_origin_test.dart
+++ b/tests/html/xhr_cross_origin_test.dart
@@ -12,8 +12,8 @@
   useHtmlConfiguration();
 
   test('XHR Cross-domain', () {
+    var url = "http://localhost:9876/tests/html/xhr_cross_origin_data.txt";
     var xhr = new HttpRequest();
-    var url = "https://code.google.com/feeds/issues/p/dart/issues/full?alt=json";
     xhr.open('GET', url, true);
     var validate = expectAsync1((data) {
       expect(data, contains('feed'));
@@ -31,7 +31,7 @@
   });
 
   test('XHR.get Cross-domain', () {
-    var url = "https://code.google.com/feeds/issues/p/dart/issues/full?alt=json";
+    var url = "http://localhost:9876/tests/html/xhr_cross_origin_data.txt";
     new HttpRequest.get(url, expectAsync1((xhr) {
       var data = JSON.parse(xhr.response);
       expect(data, contains('feed'));
diff --git a/tests/isolate/count_test.dart b/tests/isolate/count_test.dart
index fe8957d..2bee065 100644
--- a/tests/isolate/count_test.dart
+++ b/tests/isolate/count_test.dart
@@ -40,7 +40,7 @@
       if (count == 10) {
         remote.send(-1, reply);
       }
-    }, count: 11));
+    }, 11));
     remote.send(count++, reply);
   });
 }
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index f797607..6b2bcb4 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -46,13 +46,13 @@
 timer_test: Pass, Fail
 
 # TODO(ager): Update these.
-[ $runtime == ie && $system == windows ]
+[ $runtime == ie9 && $system == windows ]
 v2*: Skip
 
 [ $runtime == safari && $system == macos ]
 v2*: Skip
 
-[ $runtime == ie && ($system == linux || $system == macos) ]
+[ $runtime == ie9 && ($system == linux || $system == macos) ]
 *: Skip
 
 [ $runtime == safari && ($system == linux || $system == windows) ]
diff --git a/tests/isolate/timer_isolate_test.dart b/tests/isolate/timer_isolate_test.dart
index 15b22f2..63345ea 100644
--- a/tests/isolate/timer_isolate_test.dart
+++ b/tests/isolate/timer_isolate_test.dart
@@ -26,6 +26,7 @@
       expect("timer_fired", msg);
       int endTime = (new Date.now()).millisecondsSinceEpoch;
       expect((endTime - startTime) >= TIMEOUT);
+      port.close();
     }));
     
     startTime = (new Date.now()).millisecondsSinceEpoch;
diff --git a/tests/json/json.status b/tests/json/json.status
index 48e61ee..9d9b4cd 100644
--- a/tests/json/json.status
+++ b/tests/json/json.status
@@ -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.
 
-[ $runtime == ie && ($system == linux || $system == macos) ]
+[ $runtime == ie9 && ($system == linux || $system == macos) ]
 *: Skip
 
 [ $runtime == safari && ($system == linux || $system == windows) ]
diff --git a/tests/language/argument_definition_test.dart b/tests/language/argument_definition_test.dart
index 2120602..14d7e6d 100644
--- a/tests/language/argument_definition_test.dart
+++ b/tests/language/argument_definition_test.dart
@@ -55,6 +55,8 @@
   };
 }
 
+tl_test([a]) => ?a;
+
 main() {
   // Use a loop to test optimized version as well.
   for (int i = 0; i < 1000; i++) {
@@ -67,5 +69,8 @@
     Expect.equals(720, closure_test(1, b: 2)());
     Expect.equals(523, closure_test(1, b: 2, c: 3)());
     Expect.equals(703, closure_test(1, c: 3)());
+
+    Expect.equals(true, tl_test(0));
+    Expect.equals(false, tl_test());
   }
 }
diff --git a/tests/language/call_operator_test.dart b/tests/language/call_operator_test.dart
index 56ef41e..386d1f2 100644
--- a/tests/language/call_operator_test.dart
+++ b/tests/language/call_operator_test.dart
@@ -29,7 +29,7 @@
 
 // Non-trivial method body combination of positional and named.
 class E {
-  String call(String str, [int count=1]) {
+  String call(String str, {int count: 1}) {
     StringBuffer buffer = new StringBuffer();
     for (var i = 0; i < count; i++) {
       buffer.add(str);
@@ -61,16 +61,16 @@
   var d = new D();
   Expect.equals(42, d());
   Expect.equals(7, d(1));
-  Expect.equals(14, d(arg:2));
+  Expect.equals(14, d(2));
   Expect.equals(42, d.call());
   Expect.equals(7, d.call(1));
-  Expect.equals(14, d.call(arg:2));
+  Expect.equals(14, d.call(2));
 
   var e = new E();
   Expect.equals("foo", e("foo"));
-  Expect.equals("foo:foo", e("foo", 2));
+  Expect.equals("foo:foo", e("foo", count:2));
   Expect.equals("foo:foo:foo", e("foo", count:3));
   Expect.equals("foo", e.call("foo"));
-  Expect.equals("foo:foo", e.call("foo", 2));
+  Expect.equals("foo:foo", e.call("foo", count:2));
   Expect.equals("foo:foo:foo", e.call("foo", count:3));
 }
diff --git a/tests/language/compile_time_constant_test.dart b/tests/language/compile_time_constant_test.dart
index ca43339..53e9198 100644
--- a/tests/language/compile_time_constant_test.dart
+++ b/tests/language/compile_time_constant_test.dart
@@ -4,9 +4,9 @@
 
 class Bad {
   int foo;
-  static int bar
-      = foo /// 01: compile-time error
-      ;
+  const int bar =
+      foo /// 01: compile-time error
+      -1;
   static const int toto =
       bar /// 02: compile-time error
       -3;
@@ -15,6 +15,6 @@
 void use(x) {}
 
 main() {
-  use(Bad.bar);
+  use(new Bad().bar);
   use(Bad.toto);
 }
diff --git a/tests/language/constructor5_test.dart b/tests/language/constructor5_test.dart
index fe21bc6..c087840 100644
--- a/tests/language/constructor5_test.dart
+++ b/tests/language/constructor5_test.dart
@@ -14,7 +14,7 @@
 }
 
 class A {
-  A([arg1 = 100, arg2 = 200]) : a1 = E(arg1++), a2 = E(arg2++) {
+  A({arg1: 100, arg2: 200}) : a1 = E(arg1++), a2 = E(arg2++) {
     // b2 should be initialized between the above initializers and the following
     // statements.
     E(arg1);  // 101
diff --git a/tests/language/import_core_impl_no_prefix_test.dart b/tests/language/import_core_impl_no_prefix_test.dart
index afd51d6..434d606 100644
--- a/tests/language/import_core_impl_no_prefix_test.dart
+++ b/tests/language/import_core_impl_no_prefix_test.dart
@@ -8,6 +8,6 @@
 #import("dart:coreimpl");
 
 main() {
-  var e = new ExceptionImplementation("test, test, test");
+  var e = new SplayTreeMap();
   print('"dart:coreimpl" imported, $e allocated');
 }
diff --git a/tests/language/issue4157508_test.dart b/tests/language/issue4157508_test.dart
index b80ec4b..54a938a 100644
--- a/tests/language/issue4157508_test.dart
+++ b/tests/language/issue4157508_test.dart
@@ -4,7 +4,7 @@
 
 class Issue4157508Test {
   Issue4157508Test(var v) {
-    var d = new Date.fromMillisecondsSinceEpoch(v, true);
+    var d = new Date.fromMillisecondsSinceEpoch(v, isUtc: true);
   }
 
   static void testMain() {
diff --git a/tests/language/language.status b/tests/language/language.status
index 4768cab..b12c7a1 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -38,8 +38,6 @@
 # Issue 1355
 call_operator_test: Fail
 
-constructor_redirect_test/01: Fail # Issue 2103.
-
 closure_with_super_send_test: Fail # Issue 3197.
 closure_with_super_field_test: Fail # Issue 3197.
 super_closure_test: Fail # Issue 3197.
@@ -133,6 +131,7 @@
 class_literal_test/28 : Fail # language change 3368
 class_literal_test/29 : Fail # language change 3368
 closure_call_wrong_argument_count_negative_test: Fail # Runtime only test, rewrite as multitest
+compile_time_constant_test/02: Fail # issue 5987.
 compile_time_constant10_test/none: Fail # issue 5215.
 constructor3_negative_test: Fail # Runtime only test, rewrite as multitest
 constructor_call_wrong_argument_count_negative_test: Fail # Runtime only test, rewrite as multitest
@@ -169,7 +168,6 @@
 prefix11_negative_test : Fail # language change 1031
 private_member3_negative_test: Fail # Runtime only test?  rewrite as multitest
 pseudo_kw_illegal_test/09: Fail, OK # 'interface' is not a built-in identifier
-pseudo_kw_illegal_test/11: Fail, OK # 'negate' is not a built-in identifier
 pseudo_kw_illegal_test/14: Fail, OK # 'source' is not a built-in identifier
 resource_test: Fail # out of date - resource directives have been removed
 static_call_wrong_argument_count_negative_test: Fail # Runtime only test, rewrite as multitest
@@ -190,9 +188,6 @@
 type_parameter_test/04: Fail, OK
 type_variable_scope2_test: Fail, OK
 
-# test issue 5333
-named_constructor_test: Fail, OK
-naming_test: Fail, OK
 
 # test issue 5337
 bad_constructor_test/05: Fail, OK
@@ -234,7 +229,7 @@
 [ $runtime == opera ]
 *: Skip
 
-[ $runtime == ie && ($system == linux || $system == macos) ]
+[ $runtime == ie9 && ($system == linux || $system == macos) ]
 *: Skip
 
 [ $runtime == safari && ($system == linux || $system == windows) ]
@@ -271,7 +266,6 @@
 compile_time_constant_arguments_test/04: Fail # http://dartbug.com/5519
 compile_time_constant_arguments_test/05: Fail # http://dartbug.com/5519
 compile_time_constant_arguments_test/06: Fail # http://dartbug.com/5519
-compile_time_constant_test/02: Fail # http://dartbug.com/5519
 const_constructor_syntax_test/04: Fail # http://dartbug.com/5519
 const_constructor_syntax_test/05: Fail # http://dartbug.com/5519
 const_syntax_test/01: Fail # http://dartbug.com/5519
@@ -300,7 +294,7 @@
 named_parameters_aggregated_test/01: Fail # http://dartbug.com/5519
 named_parameters_aggregated_test/03: Fail # http://dartbug.com/5519
 named_parameters_aggregated_test/04: Fail # http://dartbug.com/5519
-new_expression_type_args_test/01: Fail # http://dartbug.com/5519
+new_expression_type_args_test/02: Fail # inherited from dart2js
 not_enough_positional_arguments_test/01: Fail # http://dartbug.com/5519
 override_field_test/04: Fail # http://dartbug.com/5519
 static_field3_test/01: Fail # http://dartbug.com/5519
@@ -328,7 +322,6 @@
 # chokes on things like typedef(x) => "typedef $x" and alike.
 abstract_syntax_test/01: Fail
 abstract_syntax_test/02: Fail
-pseudo_kw_illegal_test/11: Fail
 pseudo_kw_illegal_test/14: Fail
 pseudo_kw_test: Fail
 # external keyword is not yet supported by dart2js/dart2dart.
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index eed6019..1a43554 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -40,6 +40,7 @@
 
 [ $compiler == dart2js && $unchecked ]
 assertion_test: Fail
+new_expression_type_args_test/02: Fail # dart2js fails to reject type variable within static member
 
 # Only checked mode reports an error on type assignment
 # problems in compile time constants.
@@ -68,7 +69,6 @@
 getter_no_setter_test/01: Fail # http://dartbug.com/5519
 illegal_invocation_test/03: Fail # http://dartbug.com/5519
 isnot_malformed_type_test/01: Fail # http://dartbug.com/5519
-new_expression_type_args_test/01: Fail # http://dartbug.com/5519
 not_enough_positional_arguments_test/01: Fail # http://dartbug.com/5519
 not_enough_positional_arguments_test/02: Fail # http://dartbug.com/5519
 optional_named_parameters_test/01: Fail # http://dartbug.com/5519
@@ -89,13 +89,24 @@
 compile_time_constant8_test: Fail # We don't take the generic type into account yet.
 canonical_const_test: Fail # We don't take the generic type into account yet.
 
-function_type_alias_test: Fail # Support for optional parameters not conform to latest spec.
-function_type_alias2_test: Fail # Support for optional parameters not conform to latest spec.
-named_parameters_type_test: Fail # Support for optional parameters not conform to latest spec.
-positional_parameters_type_test: Fail # Support for optional parameters not conform to latest spec.
-named_parameters_test/0*: Fail # Support for optional parameters not conform to latest spec.
-named_parameters_test/1*: Fail # Support for optional parameters not conform to latest spec.
-named_parameters_with_object_property_names_test: Fail # Support for optional parameters not conform to latest spec.
+# These tests will pass once new optional parameter semantics is enforced.
+named_parameters_test/02: Fail
+named_parameters_test/04: Fail
+named_parameters_test/06: Fail
+named_parameters_test/08: Fail
+named_parameters_test/10: Fail
+
+# Support for optional parameters not conform to latest spec.
+function_type_alias_test: Fail
+function_type_alias2_test: Fail
+named_parameters_type_test: Fail
+positional_parameters_type_test: Fail
+named_parameters_test/01: Fail
+named_parameters_test/03: Fail
+named_parameters_test/05: Fail
+named_parameters_test/07: Fail
+named_parameters_test/09: Fail
+named_parameters_with_object_property_names_test: Fail
 
 # Fail "const EmptyLink<Element>" must be a compile-time constant if unchecked on linux.
 # Crash infinite loop on Mac and dart2js checked mode on linux.
@@ -266,7 +277,6 @@
 prefix20_negative_test: Fail # Negative language test.
 prefix23_negative_test: Fail # Negative language test.
 pseudo_kw_illegal_test/03: Fail # Negative language test.
-pseudo_kw_illegal_test/11: Fail # Negative language test.
 pseudo_kw_illegal_test/14: Fail # Negative language test.
 scope_negative_test: Fail # Negative language test.
 setter_declaration2_negative_test: Fail # Negative language test.
@@ -326,7 +336,7 @@
 call_through_null_getter_test: Fail # Expected: ObjectNotClosureException got: Instance of 'TypeError'
 double_to_string_as_fixed_test: Fail
 
-[ $compiler == dart2js && $runtime == ie ]
+[ $compiler == dart2js && $runtime == ie9 ]
 call_through_getter_test: Fail
 call_through_null_getter_test: Fail
 div_by_zero_test: Fail
@@ -349,11 +359,9 @@
 
 [ $compiler == dart2js && $runtime == ff && $system == windows ]
 prefix_new_test: Fail # TODO(ahe): Enable wrapper-less tests on Firefox/Windows.
-first_class_types_test: Fail # http://dartbug.com/5523
 part2_test: Fail # TODO(ahe): Enable wrapper-less tests on Firefox/Windows.
 part_test: Fail # TODO(ahe): Enable wrapper-less tests on Firefox/Windows.
 export_test: Fail # Issue 5785 (root cause: issue 2264)
 export_cyclic_test: Fail # Issue 5785 (root cause: issue 2264)
-generic_creation_test: Fail # Issue 5785 (root cause: issue 2264)
 import_combinators_test: Fail # Issue 5785 (root cause: issue 2264)
 first_class_types_libraries_test: Fail
diff --git a/tests/language/named_constructor_test.dart b/tests/language/named_constructor_test.dart
deleted file mode 100644
index 51429d3..0000000
--- a/tests/language/named_constructor_test.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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.
-
-class NamedConstructorTest {
-  int x_;
-
-  NamedConstructorTest.fill(int x) {
-    // Should resolve to the fill method
-    fill(x);
-  }
-
-  void fill(int x) {
-    x_ = x;
-  }
-
-  static testMain() {
-    var a = new NamedConstructorTest.fill(3);
-    assert(a.x_ == 3);
-  }
-}
-
-main() {
-  NamedConstructorTest.testMain();
-}
diff --git a/tests/language/named_parameter_regression_test.dart b/tests/language/named_parameter_regression_test.dart
new file mode 100644
index 0000000..a702464
--- /dev/null
+++ b/tests/language/named_parameter_regression_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2012, 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.
+
+// A regression test for dart2js bug 6015.
+
+class Fisk {
+  foo({b, a: true}) {
+    if (b == null) return;
+    throw 'broken';
+  }
+
+  bar({a, b: true}) {
+    if (a == null) return;
+    throw 'broken';
+  }
+}
+
+main() {
+  new Fisk().foo(a: true);
+  new Fisk().bar(b: true);
+}
diff --git a/tests/language/naming_test.dart b/tests/language/naming_test.dart
index 2e734b4..0533899 100644
--- a/tests/language/naming_test.dart
+++ b/tests/language/naming_test.dart
@@ -488,18 +488,6 @@
 $add(Object first, Object second) => second;
 DartQuery $(Object obj) => new DartQuery(obj);
 
-// Ensure we don't have false positive. named constructor and methods
-// are in different namespaces, therefore it is ok to have a method
-// called foo and a named constructor CLASS.foo
-class Naming1Test {
-  Naming1Test.foo() { }
-  foo() { }
-
-  static void main(args) {
-    var a = new Naming1Test.foo();
-    a.foo();
-  }
-}
 
 // Ensure we don't have false positive.
 class Naming2Test {
@@ -521,6 +509,5 @@
 
 main() {
   NamingTest.testMain();
-  Naming1Test.main(null);
   Naming2Test.main(null);
 }
diff --git a/tests/language/optimized_hoisting_checked_mode_assert.dart b/tests/language/optimized_hoisting_checked_mode_assert.dart
new file mode 100644
index 0000000..2f67833
--- /dev/null
+++ b/tests/language/optimized_hoisting_checked_mode_assert.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2012, 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 checked mode assertions inside loops.
+
+int foo(x, n)  {
+  double z = 0.0;
+  for (var i=0; i<n; i++) {
+    double z = x;
+  }
+  return 0;
+}
+
+main() {
+  for (var i=0; i<10000; i++) foo(1.0, 10);
+  Expect.equals(0, foo(1.0, 10));
+  Expect.equals(0, foo(2, 0));  // Must not throw in checked mode.
+}
+
diff --git a/tests/language/pseudo_kw_illegal_test.dart b/tests/language/pseudo_kw_illegal_test.dart
index 5a113a3..a8962b1 100644
--- a/tests/language/pseudo_kw_illegal_test.dart
+++ b/tests/language/pseudo_kw_illegal_test.dart
@@ -13,8 +13,6 @@
 class import { }      /// 08: compile-time error
 class interface { }   /// 09: compile-time error
 class library { }     /// 10: compile-time error
-// TODO(hausner): remove negate when removing old operator syntax.
-class negate { }      /// 11: compile-time error
 class operator { }    /// 12: compile-time error
 class set { }         /// 13: compile-time error
 class source { }      /// 14: compile-time error
diff --git a/tests/lib/math/coin_test.dart b/tests/lib/math/coin_test.dart
index 00f8f8c..3c976ff 100644
--- a/tests/lib/math/coin_test.dart
+++ b/tests/lib/math/coin_test.dart
@@ -25,5 +25,5 @@
   print("Heads: $heads\n"
         "Tails: $tails\n"
         "Ratio: ${heads/tails}\n");
-  Expect.approxEquals(1.0, heads/tails, tolerance:0.1);
+  Expect.approxEquals(1.0, heads/tails, 0.1);
 }
\ No newline at end of file
diff --git a/tests/standalone/byte_array_test.dart b/tests/standalone/byte_array_test.dart
index 1565488..e23715f 100644
--- a/tests/standalone/byte_array_test.dart
+++ b/tests/standalone/byte_array_test.dart
@@ -20,6 +20,42 @@
   for (int i = 0; i < 10; i++) {
     Expect.equals(0, byteArray[i]);
   }
+  
+}
+
+void testUnsignedByteArrayRange() {
+  Uint8List byteArray;
+  byteArray = new Uint8List(10);
+
+  byteArray[1] = 255;
+  Expect.equals(255, byteArray[1]);
+  byteArray[1] = 0;
+  Expect.equals(0, byteArray[1]);
+  
+  Expect.throws(() {
+    byteArray[1] = 1.2;
+  });
+  // These should eventually throw.
+  byteArray[1] = 256;
+  byteArray[1] = -1;
+  byteArray[2] = -129;
+}
+
+void testByteArrayRange() {
+  Int8List byteArray;
+  byteArray = new Int8List(10);
+  byteArray[1] = 0;
+  Expect.equals(0, byteArray[1]);
+  byteArray[2] = -128;
+  Expect.equals(-128, byteArray[2]);
+  byteArray[3] = 127;
+  Expect.equals(127, byteArray[3]);
+  Expect.throws(() {
+    byteArray[1] = 1.2;
+  });
+  // This should eventually throw.
+  byteArray[0] = 128;
+  byteArray[4] = -129;
 }
 
 void testSetRange() {
@@ -122,6 +158,8 @@
 main() {
   for (int i = 0; i < 2000; i++) {
     testCreateByteArray();
+    testByteArrayRange();
+    testUnsignedByteArrayRange();
     testSetRange();
     testIndexOutOfRange();
     testIndexOf();
diff --git a/tests/standalone/float_array_test.dart b/tests/standalone/float_array_test.dart
index 0b5db71..bcd52ac 100644
--- a/tests/standalone/float_array_test.dart
+++ b/tests/standalone/float_array_test.dart
@@ -177,20 +177,39 @@
   });

 }

 

+storeIt32(Float32List a, int index, value) {

+  a[index] = value;

+}

+

+storeIt64(Float64List a, int index, value) {

+  a[index] = value;

+}

+

 main() {

+  var a32 = new Float32List(5);

   for (int i = 0; i < 2000; i++) {

     testCreateFloat32Array();

     testSetRange32();

     testIndexOutOfRange32();

     testIndexOf32();

+    storeIt32(a32, 1, 2.0);

   }

+  var a64 = new Float64List(5);

   for (int i = 0; i < 2000; i++) {

     testCreateFloat64Array();

     testSetRange64();

     testIndexOutOfRange64();

     testIndexOf64();

+    storeIt64(a64, 1, 2.0);

   }

   // These two take a long time in checked mode.

   testBadValues32();

   testBadValues64();

+  // Check optimized (inlined) version of []=

+  Expect.throws(() {

+    storeIt32(a32, 1, 2);

+  });

+  Expect.throws(() {

+    storeIt64(a64, 1, 2);

+  });

 }

diff --git a/tests/standalone/int_array_test.dart b/tests/standalone/int_array_test.dart
new file mode 100644
index 0000000..dfab86e
--- /dev/null
+++ b/tests/standalone/int_array_test.dart
@@ -0,0 +1,95 @@
+// Copyright (c) 2012, 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.
+//
+// Dart test program for testing native int arrays.
+
+// Library tag to be able to run in html test framework.
+#library("IntArrayTest.dart");
+
+#import('dart:scalarlist');
+
+void testInt32ToSmi() {
+  Int32List intArray;
+
+  intArray = new Int32List(4);
+  intArray[0] = 1073741823;  // SmiMax
+  intArray[1] = -1073741824;  // SmiMin
+  intArray[2] = 1073741824;  // SmiMax+1
+  intArray[3] = -1073741825;  // SmiMin-1
+  var x = intArray[0];
+  var y = intArray[1];
+  var z = intArray[2];
+  var w = intArray[3];
+  Expect.equals(1073741823, x);
+  Expect.equals(-1073741824, y);
+  Expect.equals(1073741824, z);
+  Expect.equals(-1073741825, w);
+}
+
+void testUint32ToSmi() {
+  Uint32List intArray;
+
+  intArray = new Uint32List(4);
+  intArray[0] = 1073741823;  // SmiMax
+  intArray[1] = -1;  // 0xFFFFFFFF : 4294967295
+  intArray[2] = 1073741830;  // SmiMax+7
+  intArray[3] = -1073741825;  // 0xbfffffff : 3221225471
+  var x = intArray[0];
+  var y = intArray[1];
+  var z = intArray[2];
+  var w = intArray[3];
+  Expect.equals(1073741823, x);
+  Expect.equals(4294967295, y);
+  Expect.equals(1073741830, z);
+  Expect.equals(3221225471, w);
+}
+
+void testInt64ToSmi() {
+  Int64List intArray;
+
+  intArray = new Int64List(4);
+  intArray[0] = 4611686018427387903;  // SmiMax
+  intArray[1] = -4611686018427387904; // SmiMin
+  intArray[2] = 4611686018427387904;  // SmiMax+1
+  intArray[3] = -4611686018427387905;  // SmiMin-1
+  var x = intArray[0];
+  var y = intArray[1];
+  var z = intArray[2];
+  var w = intArray[3];
+  Expect.equals(4611686018427387903, x);
+  Expect.equals(-4611686018427387904, y);
+  Expect.equals(4611686018427387904, z);
+  Expect.equals(-4611686018427387905, w);
+}
+
+void testUint64ToSmi() {
+  Uint64List intArray;
+
+  intArray = new Uint64List(4);
+  intArray[0] = 4611686018427387903;  // SmiMax
+  intArray[1] = -1;  // 0xFFFFFFFFFFFFFFFF : 18446744073709551615
+  intArray[2] = 4611686018427387904; // SmiMax+1
+  intArray[3] = 9223372036854775808;
+  var x = intArray[0];
+  var y = intArray[1];
+  var z = intArray[2];
+  var w = intArray[3];
+  print(w);
+  Expect.equals(4611686018427387903, x);
+  Expect.equals(18446744073709551615, y);
+  Expect.equals(4611686018427387904, z);
+  Expect.equals(9223372036854775808, w);
+}
+
+
+main() {
+  testUint64ToSmi();
+  return;
+  for (int i = 0; i < 2000; i++) {
+    testInt32ToSmi();
+    testUint32ToSmi();
+    testInt64ToSmi();
+    testUint64ToSmi();
+  }
+}
diff --git a/tests/standalone/io/dart_std_io_pipe_test.dart b/tests/standalone/io/dart_std_io_pipe_test.dart
index 95019e5..1642fa6 100644
--- a/tests/standalone/io/dart_std_io_pipe_test.dart
+++ b/tests/standalone/io/dart_std_io_pipe_test.dart
@@ -40,39 +40,39 @@
   String executable = new Options().executable;
   List args =
       [executable, dartScript, type, pipeOutFile, redirectOutFile];
-  Process process = Process.start(shellScript, args);
+  var future = Process.start(shellScript, args);
+  future.then((process) {
+    process.onExit = (exitCode) {
+      Expect.equals(0, exitCode);
+      process.close();
 
-  // Wait for the process to exit and then check result.
-  process.onExit = (exitCode) {
-    Expect.equals(0, exitCode);
-    process.close();
+      // Check the expected file contents.
+      if (type == "0") {
+        checkFileContent("${pipeOutFile}", "Hello\n");
+        checkFileEmpty("${redirectOutFile}.stderr");
+        checkFileContent("${redirectOutFile}.stdout", "Hello\nHello\n");
+      }
+      if (type == "1") {
+        checkFileContent("${pipeOutFile}", "Hello\n");
+        checkFileEmpty("${redirectOutFile}.stdout");
+        checkFileContent("${redirectOutFile}.stderr", "Hello\nHello\n");
+      }
+      if (type == "2") {
+        checkFileContent("${pipeOutFile}", "Hello\nHello\n");
+        checkFileContent("${redirectOutFile}.stdout",
+                         "Hello\nHello\nHello\nHello\n");
+        checkFileContent("${redirectOutFile}.stderr",
+                         "Hello\nHello\nHello\nHello\n");
+      }
 
-    // Check the expected file contents.
-    if (type == "0") {
-      checkFileContent("${pipeOutFile}", "Hello\n");
-      checkFileEmpty("${redirectOutFile}.stderr");
-      checkFileContent("${redirectOutFile}.stdout", "Hello\nHello\n");
-    }
-    if (type == "1") {
-      checkFileContent("${pipeOutFile}", "Hello\n");
-      checkFileEmpty("${redirectOutFile}.stdout");
-      checkFileContent("${redirectOutFile}.stderr", "Hello\nHello\n");
-    }
-    if (type == "2") {
-      checkFileContent("${pipeOutFile}", "Hello\nHello\n");
-      checkFileContent("${redirectOutFile}.stdout",
-                       "Hello\nHello\nHello\nHello\n");
-      checkFileContent("${redirectOutFile}.stderr",
-                       "Hello\nHello\nHello\nHello\n");
-    }
-
-    // Cleanup test directory.
+      // Cleanup test directory.
+      dir.deleteRecursivelySync();
+    };
+  });
+  future.handleException((ProcessException error) {
     dir.deleteRecursivelySync();
-  };
-
-  process.onError = (ProcessException error) {
     Expect.fail(error.toString());
-  };
+  });
 }
 
 // This tests that the Dart standalone VM can handle piping to stdin
diff --git a/tests/standalone/io/directory_invalid_arguments_test.dart b/tests/standalone/io/directory_invalid_arguments_test.dart
index a34836f..051b0df 100644
--- a/tests/standalone/io/directory_invalid_arguments_test.dart
+++ b/tests/standalone/io/directory_invalid_arguments_test.dart
@@ -7,7 +7,7 @@
 class DirectoryInvalidArgumentsTest {
   static void testFailingList(Directory d, var recursive) {
     int errors = 0;
-    var lister = d.list(recursive);
+    var lister = d.list(recursive: recursive);
     lister.onError = (error) {
       errors += 1;
     };
diff --git a/tests/standalone/io/echo_server_stream_test.dart b/tests/standalone/io/echo_server_stream_test.dart
index 505abc4..c30fc95 100644
--- a/tests/standalone/io/echo_server_stream_test.dart
+++ b/tests/standalone/io/echo_server_stream_test.dart
@@ -95,7 +95,7 @@
           break;
         case 3:
           Expect.equals(0, _buffer.length % 2);
-          stream.writeFrom(_buffer, len: _buffer.length ~/ 2);
+          stream.writeFrom(_buffer, 0, _buffer.length ~/ 2);
           stream.writeFrom(_buffer, _buffer.length ~/ 2);
           break;
       }
diff --git a/tests/standalone/io/file_test.dart b/tests/standalone/io/file_test.dart
index b76a9de..70d7f79 100644
--- a/tests/standalone/io/file_test.dart
+++ b/tests/standalone/io/file_test.dart
@@ -216,14 +216,14 @@
       };
       input.onData = () {
         Expect.isFalse(input.closed);
-        bytesRead = input.readInto(inputBuffer, offset: position,
-                                   len: inputBuffer.length - position);
+        bytesRead = input.readInto(inputBuffer, position,
+                                   inputBuffer.length - position);
         position += bytesRead;
         // The buffer is large enough to hold all available data.
         // So there should be no data left to read.
         Expect.equals(0, input.available());
-        bytesRead = input.readInto(inputBuffer, offset: position,
-                                   len: expectedLength - position);
+        bytesRead = input.readInto(inputBuffer, position,
+                                   expectedLength - position);
         Expect.equals(0, bytesRead);
         Expect.equals(0, input.available());
         Expect.isFalse(input.closed);
diff --git a/tests/standalone/io/http_advanced_test.dart b/tests/standalone/io/http_advanced_test.dart
index 5542dcc..77e36fa 100644
--- a/tests/standalone/io/http_advanced_test.dart
+++ b/tests/standalone/io/http_advanced_test.dart
@@ -117,7 +117,7 @@
 
   // Set the "Expires" header using the expires property.
   void _expires1Handler(HttpRequest request, HttpResponse response) {
-    Date date = new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true);
+    Date date = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
     response.headers.expires = date;
     Expect.equals(date, response.headers.expires);
     response.outputStream.close();
@@ -126,7 +126,7 @@
   // Set the "Expires" header.
   void _expires2Handler(HttpRequest request, HttpResponse response) {
     response.headers.set("Expires", "Fri, 11 Jun 1999 18:46:53 GMT");
-    Date date = new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true);
+    Date date = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
     Expect.equals(date, response.headers.expires);
     response.outputStream.close();
   }
@@ -159,7 +159,7 @@
     Expect.equals(0, request.cookies.length);
 
     Cookie cookie1 = new Cookie("name1", "value1");
-    Date date = new Date(2014, Date.JAN, 5, 23, 59, 59, 0, isUtc: true);
+    Date date = new Date.utc(2014, Date.JAN, 5, 23, 59, 59, 0);
     cookie1.expires = date;
     cookie1.domain = "www.example.com";
     cookie1.httpOnly = true;
@@ -294,7 +294,7 @@
       Expect.equals(HttpStatus.OK, response.statusCode);
       Expect.equals("Fri, 11 Jun 1999 18:46:53 GMT",
                     response.headers["expires"][0]);
-      Expect.equals(new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true),
+      Expect.equals(new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0),
                     response.headers.expires);
       responses++;
       if (responses == 2) {
@@ -376,7 +376,7 @@
       response.cookies.forEach((cookie) {
         if (cookie.name == "name1") {
           Expect.equals("value1", cookie.value);
-          Date date = new Date(2014, Date.JAN, 5, 23, 59, 59, 0, isUtc: true);
+          Date date = new Date.utc(2014, Date.JAN, 5, 23, 59, 59, 0);
           Expect.equals(date, cookie.expires);
           Expect.equals("www.example.com", cookie.domain);
           Expect.isTrue(cookie.httpOnly);
diff --git a/tests/standalone/io/http_connection_close_test.dart b/tests/standalone/io/http_connection_close_test.dart
index 8933261..b3e8bd7 100644
--- a/tests/standalone/io/http_connection_close_test.dart
+++ b/tests/standalone/io/http_connection_close_test.dart
@@ -8,7 +8,7 @@
 
 void testHttp10Close() {
   HttpServer server = new HttpServer();
-  server.listen("127.0.0.1", 0, 5);
+  server.listen("127.0.0.1", 0, backlog: 5);
 
   Socket socket = new Socket("127.0.0.1", server.port);
   socket.onConnect = () {
@@ -24,7 +24,7 @@
 
 void testHttp11Close() {
   HttpServer server = new HttpServer();
-  server.listen("127.0.0.1", 0, 5);
+  server.listen("127.0.0.1", 0, backlog: 5);
 
   Socket socket = new Socket("127.0.0.1", server.port);
   socket.onConnect = () {
diff --git a/tests/standalone/io/http_connection_header_test.dart b/tests/standalone/io/http_connection_header_test.dart
index 5b225f5..617854a 100644
--- a/tests/standalone/io/http_connection_header_test.dart
+++ b/tests/standalone/io/http_connection_header_test.dart
@@ -33,7 +33,7 @@
 void test(int totalConnections, bool clientPersistentConnection) {
   HttpServer server = new HttpServer();
   server.onError = (e) => Expect.fail("Unexpected error $e");
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     // Check expected request.
     Expect.equals(clientPersistentConnection, request.persistentConnection);
diff --git a/tests/standalone/io/http_content_length_test.dart b/tests/standalone/io/http_content_length_test.dart
index 2baedb2..2f03c8b 100644
--- a/tests/standalone/io/http_content_length_test.dart
+++ b/tests/standalone/io/http_content_length_test.dart
@@ -9,7 +9,7 @@
 void testNoBody(int totalConnections) {
   HttpServer server = new HttpServer();
   server.onError = (e) => Expect.fail("Unexpected error $e");
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     response.contentLength = 0;
     OutputStream stream = response.outputStream;
@@ -42,7 +42,7 @@
 void testBody(int totalConnections) {
   HttpServer server = new HttpServer();
   server.onError = (e) => Expect.fail("Unexpected error $e");
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     response.contentLength = 2;
     OutputStream stream = response.outputStream;
@@ -82,7 +82,7 @@
 void testHttp10() {
   HttpServer server = new HttpServer();
   server.onError = (e) => Expect.fail("Unexpected error $e");
-  server.listen("127.0.0.1", 0, 5);
+  server.listen("127.0.0.1", 0, backlog: 5);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     OutputStream stream = response.outputStream;
     Expect.equals("1.0", request.protocolVersion);
diff --git a/tests/standalone/io/http_date_test.dart b/tests/standalone/io/http_date_test.dart
index a2b23a0..1c7df41 100644
--- a/tests/standalone/io/http_date_test.dart
+++ b/tests/standalone/io/http_date_test.dart
@@ -16,18 +16,18 @@
 
 void testParseHttpDate() {
   Date date;
-  date = new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true);
+  date = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
   Expect.equals(date, _HttpUtils.parseDate("Fri, 11 Jun 1999 18:46:53 GMT"));
   Expect.equals(date, _HttpUtils.parseDate("Friday, 11-Jun-1999 18:46:53 GMT"));
   Expect.equals(date, _HttpUtils.parseDate("Fri Jun 11 18:46:53 1999"));
 
-  date = new Date(1970, Date.JAN, 1, 0, 0, 0, 0, isUtc: true);
+  date = new Date.utc(1970, Date.JAN, 1, 0, 0, 0, 0);
   Expect.equals(date, _HttpUtils.parseDate("Thu, 1 Jan 1970 00:00:00 GMT"));
   Expect.equals(date,
                 _HttpUtils.parseDate("Thursday, 1-Jan-1970 00:00:00 GMT"));
   Expect.equals(date, _HttpUtils.parseDate("Thu Jan  1 00:00:00 1970"));
 
-  date = new Date(2012, Date.MAR, 5, 23, 59, 59, 0, isUtc: true);
+  date = new Date.utc(2012, Date.MAR, 5, 23, 59, 59, 0);
   Expect.equals(date, _HttpUtils.parseDate("Mon, 5 Mar 2012 23:59:59 GMT"));
   Expect.equals(date, _HttpUtils.parseDate("Monday, 5-Mar-2012 23:59:59 GMT"));
   Expect.equals(date, _HttpUtils.parseDate("Mon Mar  5 23:59:59 2012"));
@@ -43,7 +43,7 @@
        String expectedFormatted) {
     Date date;
     String formatted;
-    date = new Date(year, month, day, hours, minutes, seconds, 0, isUtc: true);
+    date = new Date.utc(year, month, day, hours, minutes, seconds, 0);
     formatted = _HttpUtils.formatDate(date);
     Expect.equals(expectedFormatted, formatted);
     Expect.equals(date, _HttpUtils.parseDate(formatted));
@@ -95,8 +95,7 @@
        int minutes,
        int seconds,
        String formatted) {
-    Date date = new Date(
-        year, month, day, hours, minutes, seconds, 0, isUtc: true);
+    Date date = new Date.utc(year, month, day, hours, minutes, seconds, 0);
     Expect.equals(date, _HttpUtils.parseCookieDate(formatted));
   }
 
diff --git a/tests/standalone/io/http_head_test.dart b/tests/standalone/io/http_head_test.dart
index 84e03e8..24efb91 100644
--- a/tests/standalone/io/http_head_test.dart
+++ b/tests/standalone/io/http_head_test.dart
@@ -7,7 +7,7 @@
 void testHEAD(int totalConnections) {
   HttpServer server = new HttpServer();
   server.onError = (e) => Expect.fail("Unexpected error $e");
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.addRequestHandler(
       (request) => request.path == "/test100",
       (HttpRequest request, HttpResponse response) {
diff --git a/tests/standalone/io/http_headers_test.dart b/tests/standalone/io/http_headers_test.dart
index 53ecc9e..fe1c11f 100644
--- a/tests/standalone/io/http_headers_test.dart
+++ b/tests/standalone/io/http_headers_test.dart
@@ -52,9 +52,9 @@
 }
 
 void testDate() {
-  Date date1 = new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true);
+  Date date1 = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
   String httpDate1 = "Fri, 11 Jun 1999 18:46:53 GMT";
-  Date date2 = new Date(2000, Date.AUG, 16, 12, 34, 56, 0, isUtc: true);
+  Date date2 = new Date.utc(2000, Date.AUG, 16, 12, 34, 56, 0);
   String httpDate2 = "Wed, 16 Aug 2000 12:34:56 GMT";
 
   _HttpHeaders headers = new _HttpHeaders();
@@ -78,9 +78,9 @@
 }
 
 void testExpires() {
-  Date date1 = new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true);
+  Date date1 = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
   String httpDate1 = "Fri, 11 Jun 1999 18:46:53 GMT";
-  Date date2 = new Date(2000, Date.AUG, 16, 12, 34, 56, 0, isUtc: true);
+  Date date2 = new Date.utc(2000, Date.AUG, 16, 12, 34, 56, 0);
   String httpDate2 = "Wed, 16 Aug 2000 12:34:56 GMT";
 
   _HttpHeaders headers = new _HttpHeaders();
@@ -104,9 +104,9 @@
 }
 
 void testIfModifiedSince() {
-  Date date1 = new Date(1999, Date.JUN, 11, 18, 46, 53, 0, isUtc: true);
+  Date date1 = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
   String httpDate1 = "Fri, 11 Jun 1999 18:46:53 GMT";
-  Date date2 = new Date(2000, Date.AUG, 16, 12, 34, 56, 0, isUtc: true);
+  Date date2 = new Date.utc(2000, Date.AUG, 16, 12, 34, 56, 0);
   String httpDate2 = "Wed, 16 Aug 2000 12:34:56 GMT";
 
   _HttpHeaders headers = new _HttpHeaders();
@@ -317,7 +317,7 @@
   Cookie cookie;
   cookie = new Cookie("name", "value");
   Expect.equals("name=value", cookie.toString());
-  Date date = new Date(2014, Date.JAN, 5, 23, 59, 59, 0, isUtc: true);
+  Date date = new Date.utc(2014, Date.JAN, 5, 23, 59, 59, 0);
   cookie.expires = date;
   checkCookie(cookie, "name=value"
                       "; Expires=Sun, 5 Jan 2014 23:59:59 GMT");
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart
index a73bf40..2e18a88 100644
--- a/tests/standalone/io/http_parser_test.dart
+++ b/tests/standalone/io/http_parser_test.dart
@@ -18,14 +18,14 @@
   static void _testParseRequest(String request,
                                 String expectedMethod,
                                 String expectedUri,
-                                [int expectedContentLength = -1,
-                                 int expectedBytesReceived = 0,
-                                 Map expectedHeaders = null,
-                                 bool chunked = false,
-                                 bool upgrade = false,
-                                 int unparsedLength = 0,
-                                 bool connectionClose = false,
-                                 String expectedVersion = "1.1"]) {
+                                {int expectedContentLength: -1,
+                                 int expectedBytesReceived: 0,
+                                 Map expectedHeaders: null,
+                                 bool chunked: false,
+                                 bool upgrade: false,
+                                 int unparsedLength: 0,
+                                 bool connectionClose: false,
+                                 String expectedVersion: "1.1"}) {
     _HttpParser httpParser;
     bool headersCompleteCalled;
     bool dataEndCalled;
@@ -152,16 +152,16 @@
   static void _testParseResponse(String response,
                                  int expectedStatusCode,
                                  String expectedReasonPhrase,
-                                 [int expectedContentLength = -1,
-                                  int expectedBytesReceived = 0,
-                                  Map expectedHeaders = null,
-                                  bool chunked = false,
-                                  bool close = false,
-                                  String responseToMethod = null,
-                                  bool connectionClose = false,
-                                  bool upgrade = false,
-                                  int unparsedLength = 0,
-                                  String expectedVersion = "1.1"]) {
+                                 {int expectedContentLength: -1,
+                                  int expectedBytesReceived: 0,
+                                  Map expectedHeaders: null,
+                                  bool chunked: false,
+                                  bool close: false,
+                                  String responseToMethod: null,
+                                  bool connectionClose: false,
+                                  bool upgrade: false,
+                                  int unparsedLength: 0,
+                                  String expectedVersion: "1.1"}) {
     _HttpParser httpParser;
     bool headersCompleteCalled;
     bool dataEndCalled;
diff --git a/tests/standalone/io/http_redirect_test.dart b/tests/standalone/io/http_redirect_test.dart
index 65513a9..c35cb1c 100644
--- a/tests/standalone/io/http_redirect_test.dart
+++ b/tests/standalone/io/http_redirect_test.dart
@@ -8,7 +8,7 @@
 
 HttpServer setupServer() {
   HttpServer server = new HttpServer();
-  server.listen("127.0.0.1", 0, 5);
+  server.listen("127.0.0.1", 0, backlog: 5);
 
   void addRedirectHandler(int number, int statusCode) {
     server.addRequestHandler(
diff --git a/tests/standalone/io/http_server_early_client_close_test.dart b/tests/standalone/io/http_server_early_client_close_test.dart
index 6a62b37..fcfd9a8 100644
--- a/tests/standalone/io/http_server_early_client_close_test.dart
+++ b/tests/standalone/io/http_server_early_client_close_test.dart
@@ -57,7 +57,7 @@
 
 void testEarlyClose() {
   List<EarlyCloseTest> tests = new List<EarlyCloseTest>();
-  void add(Object data, String exception, [bool expectRequest = false]) {
+  void add(Object data, String exception, {bool expectRequest: false}) {
     tests.add(new EarlyCloseTest(data, exception, expectRequest));
   }
   // The empty packet is valid.
diff --git a/tests/standalone/io/http_shutdown_test.dart b/tests/standalone/io/http_shutdown_test.dart
index f5a7fd2..0a65ea8 100644
--- a/tests/standalone/io/http_shutdown_test.dart
+++ b/tests/standalone/io/http_shutdown_test.dart
@@ -9,7 +9,7 @@
 void test1(int totalConnections) {
   // Server which just closes immediately.
   HttpServer server = new HttpServer();
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     response.outputStream.close();
   };
@@ -35,7 +35,7 @@
 void test2(int totalConnections) {
   // Server which responds without waiting for request body.
   HttpServer server = new HttpServer();
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     response.outputStream.writeString("!dlrow ,olleH");
     response.outputStream.close();
@@ -64,7 +64,7 @@
 void test3(int totalConnections) {
   // Server which responds when request body has been received.
   HttpServer server = new HttpServer();
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
   server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
     request.inputStream.onData = () {
       request.inputStream.read();
diff --git a/tests/standalone/io/process_broken_pipe_test.dart b/tests/standalone/io/process_broken_pipe_test.dart
index 91cfdea..e56ab14 100644
--- a/tests/standalone/io/process_broken_pipe_test.dart
+++ b/tests/standalone/io/process_broken_pipe_test.dart
@@ -10,15 +10,16 @@
 
 main() {
   // Running dart without arguments makes it close right away.
-  Process process = Process.start(new Options().executable, []);
+  var future = Process.start(new Options().executable, []);
+  future.then((process) {
+    // Ignore error on stdin.
+    process.stdin.onError = (e) => null;
 
-  // Ignore error on stdin.
-  process.stdin.onError = (e) => null;
-
-  // Write to the stdin after the process is terminated to test
-  // writing to a broken pipe.
-  process.onExit = (code) {
-    Expect.isFalse(process.stdin.write([0]));
-    process.close();
-  };
+    // Write to the stdin after the process is terminated to test
+    // writing to a broken pipe.
+    process.onExit = (code) {
+      Expect.isFalse(process.stdin.write([0]));
+      process.close();
+    };
+  });
 }
diff --git a/tests/standalone/io/process_check_arguments_test.dart b/tests/standalone/io/process_check_arguments_test.dart
index e246e8a..cc0f5e7 100644
--- a/tests/standalone/io/process_check_arguments_test.dart
+++ b/tests/standalone/io/process_check_arguments_test.dart
@@ -6,12 +6,13 @@
 #source("process_test_util.dart");
 
 test(args) {
-  Process process = Process.start(new Options().executable, args);
-  // Wait for the process to exit and then check result.
-  process.onExit = (exitCode) {
-    Expect.equals(0, exitCode);
-    process.close();
-  };
+  var future = Process.start(new Options().executable, args);
+  future.then((process) {
+    process.onExit = (exitCode) {
+      Expect.equals(0, exitCode);
+      process.close();
+    };
+  });
 }
 
 main() {
diff --git a/tests/standalone/io/process_exit_test.dart b/tests/standalone/io/process_exit_test.dart
index 107a933..84e5865 100644
--- a/tests/standalone/io/process_exit_test.dart
+++ b/tests/standalone/io/process_exit_test.dart
@@ -9,13 +9,14 @@
 #source("process_test_util.dart");
 
 testExit() {
-  Process process = Process.start(getProcessTestFileName(),
-                                  const ["0", "0", "99", "0"]);
-
-  process.onExit = (int exitCode) {
-    Expect.equals(exitCode, 99);
-    process.close();
-  };
+  var future = Process.start(getProcessTestFileName(),
+                             const ["0", "0", "99", "0"]);
+  future.then((process) {
+    process.onExit = (int exitCode) {
+      Expect.equals(exitCode, 99);
+      process.close();
+    };
+  });
 }
 
 testExitRun() {
diff --git a/tests/standalone/io/process_kill_unstarted_test.dart b/tests/standalone/io/process_kill_unstarted_test.dart
deleted file mode 100644
index 3ca3c40..0000000
--- a/tests/standalone/io/process_kill_unstarted_test.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2012, 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.
-//
-// Process test program to test that an unstarted process cannot be killed.
-
-#library("ProcessKillUnstartedTest");
-#import("dart:io");
-
-main() {
-  var p = Process.start('________', []);
-  Expect.throws(p.kill, (e) => e is ProcessException);
-  p.onError = (e) => Expect.isTrue(e is ProcessException);
-  p.onStart = () => Expect.fail("Process not expected to start");
-}
diff --git a/tests/standalone/io/process_segfault_test.dart b/tests/standalone/io/process_segfault_test.dart
index 53ffaab..541a4f6 100644
--- a/tests/standalone/io/process_segfault_test.dart
+++ b/tests/standalone/io/process_segfault_test.dart
@@ -9,13 +9,14 @@
 #source("process_test_util.dart");
 
 testExit() {
-  Process process = Process.start(getProcessTestFileName(),
-                                  const ["0", "0", "1", "1"]);
-
-  process.onExit = (int exitCode) {
-    Expect.isTrue(exitCode != 0);
-    process.close();
-  };
+  var future = Process.start(getProcessTestFileName(),
+                             const ["0", "0", "1", "1"]);
+  future.then((process) {
+    process.onExit = (int exitCode) {
+      Expect.isTrue(exitCode != 0);
+      process.close();
+    };
+  });
 }
 
 
diff --git a/tests/standalone/io/process_start_exception_test.dart b/tests/standalone/io/process_start_exception_test.dart
index 4909a0e..d5f6884 100644
--- a/tests/standalone/io/process_start_exception_test.dart
+++ b/tests/standalone/io/process_start_exception_test.dart
@@ -7,19 +7,17 @@
 #import("dart:io");
 
 testStartError() {
-  Process process = Process.start("__path_to_something_that_should_not_exist__",
-                                  const []);
-
-  process.onExit = (int exitCode) {
-    Expect.fail("exit handler called");
-  };
-
-  process.onError = (ProcessException e) {
+  Future<Process> processFuture =
+      Process.start("__path_to_something_that_should_not_exist__",
+                    const []);
+  processFuture.then((p) => Expect.fail('got process despite start error'));
+  processFuture.handleException((e) {
+    Expect.isTrue(e is ProcessException);
     Expect.equals(2, e.errorCode, e.toString());
-  };
+    return true;
+  });
 }
 
-
 testRunError() {
   Future<ProcessResult> processFuture =
       Process.run("__path_to_something_that_should_not_exist__",
diff --git a/tests/standalone/io/process_stderr_test.dart b/tests/standalone/io/process_stderr_test.dart
index 11141e3..49336e1 100644
--- a/tests/standalone/io/process_stderr_test.dart
+++ b/tests/standalone/io/process_stderr_test.dart
@@ -14,9 +14,12 @@
 
 #source('process_test_util.dart');
 
-void test(Process process, int expectedExitCode) {
-  // Wait for the process to start and then interact with it.
-  process.onStart = () {
+void test(Future<Process> future, int expectedExitCode) {
+  future.then((process) {
+    process.onExit = (exitCode) {
+      Expect.equals(expectedExitCode, exitCode);
+    };
+
     List<int> data = "ABCDEFGHI\n".charCodes();
     final int dataSize = data.length;
 
@@ -50,11 +53,8 @@
     output.write(data);
     output.close();
     input.onData = readData;
-  };
 
-  process.onExit = (exitCode) {
-    Expect.equals(expectedExitCode, exitCode);
-  };
+  });
 }
 
 main() {
diff --git a/tests/standalone/io/process_stdout_test.dart b/tests/standalone/io/process_stdout_test.dart
index 3ade8fe..614d161 100644
--- a/tests/standalone/io/process_stdout_test.dart
+++ b/tests/standalone/io/process_stdout_test.dart
@@ -14,9 +14,12 @@
 
 #source("process_test_util.dart");
 
-void test(Process process, int expectedExitCode) {
-  // Wait for the process to start and then interact with it.
-  process.onStart = () {
+void test(Future<Process> future, int expectedExitCode) {
+  future.then((process) {
+    process.onExit = (exitCode) {
+      Expect.equals(expectedExitCode, exitCode);
+    };
+
     List<int> data = "ABCDEFGHI\n".charCodes();
     final int dataSize = data.length;
 
@@ -50,11 +53,7 @@
     output.write(data);
     output.close();
     input.onData = readData;
-  };
-
-  process.onExit = (exitCode) {
-    Expect.equals(expectedExitCode, exitCode);
-  };
+  });
 }
 
 main() {
diff --git a/tests/standalone/io/process_working_directory_test.dart b/tests/standalone/io/process_working_directory_test.dart
index 55a0ad7..1255518 100644
--- a/tests/standalone/io/process_working_directory_test.dart
+++ b/tests/standalone/io/process_working_directory_test.dart
@@ -22,20 +22,19 @@
 
     var options = new ProcessOptions();
     options.workingDirectory = directory.path;
-    Process process = Process.start(fullTestFilePath,
-                                    const ["0", "0", "99", "0"],
-                                    options);
-
-    process.onExit = (int exitCode) {
-      Expect.equals(exitCode, 99);
-      process.close();
+    var processFuture =
+        Process.start(fullTestFilePath, const ["0", "0", "99", "0"], options);
+    processFuture.then((process) {
+      process.onExit = (int exitCode) {
+        Expect.equals(exitCode, 99);
+        process.close();
+        directory.deleteSync();
+      };
+    });
+    processFuture.handleException((error) {
       directory.deleteSync();
-    };
-
-    process.onError = (error) {
-      Expect.fail("error running process $error");
-      directory.deleteSync();
-    };
+      Expect.fails("Couldn't start process");
+    });
   }
 
   static void testInvalidDirectory() {
@@ -44,20 +43,20 @@
 
     var options = new ProcessOptions();
     options.workingDirectory = directory.path.concat("/subPath");
-    Process process = Process.start(fullTestFilePath,
-                                    const ["0", "0", "99", "0"],
-                                    options);
-
-    process.onExit = (int exitCode) {
+    var future = Process.start(fullTestFilePath,
+                               const ["0", "0", "99", "0"],
+                               options);
+    future.then((process) {
       Expect.fail("bad process completed");
       process.close();
       directory.deleteSync();
-    };
+    });
 
-    process.onError = (error) {
-      Expect.isNotNull(error);
+    future.handleException((e) {
+      Expect.isNotNull(e);
       directory.deleteSync();
-    };
+      return true;
+    });
   }
 }
 
diff --git a/tests/standalone/io/stream_pipe_test.dart b/tests/standalone/io/stream_pipe_test.dart
index 22b7fac..42f86de 100644
--- a/tests/standalone/io/stream_pipe_test.dart
+++ b/tests/standalone/io/stream_pipe_test.dart
@@ -19,9 +19,9 @@
 
 bool compareFileContent(String fileName1,
                         String fileName2,
-                        [int file1Offset = 0,
-                         int file2Offset = 0,
-                         int count]) {
+                        {int file1Offset: 0,
+                         int file2Offset: 0,
+                         int count}) {
   var file1 = new File(fileName1).openSync();
   var file2 = new File(fileName2).openSync();
   var length1 = file1.lengthSync();
diff --git a/tests/standalone/io/web_socket_test.dart b/tests/standalone/io/web_socket_test.dart
index 31d6164..831de7c 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -11,7 +11,7 @@
   HttpServer server = new HttpServer();
   HttpClient client = new HttpClient();
 
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
 
   // Create a web socket handler and set is as the HTTP server default
   // handler.
@@ -64,7 +64,7 @@
   HttpServer server = new HttpServer();
   HttpClient client = new HttpClient();
 
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
 
   // Create a web socket handler and set is as the HTTP server default
   // handler.
@@ -115,7 +115,7 @@
   HttpServer server = new HttpServer();
   HttpClient client = new HttpClient();
 
-  server.listen("127.0.0.1", 0, 1);
+  server.listen("127.0.0.1", 0, backlog: 1);
 
   // Create a web socket handler and set is as the HTTP server default
   // handler.
@@ -150,7 +150,7 @@
   HttpServer server = new HttpServer();
   HttpClient client = new HttpClient();
 
-  server.listen("127.0.0.1", 0, 5);
+  server.listen("127.0.0.1", 0, backlog: 5);
 
   // Create a server which always responds with a redirect.
   server.defaultRequestHandler = (request, response) {
@@ -173,7 +173,7 @@
   HttpServer server = new HttpServer();
   HttpClient client = new HttpClient();
 
-  server.listen("127.0.0.1", 0, 5);
+  server.listen("127.0.0.1", 0, backlog: 5);
 
   // Create a web socket handler and set is as the HTTP server default
   // handler.
@@ -204,7 +204,7 @@
   HttpClient client = new HttpClient();
   Map connections = new Map();
 
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
 
   void handleMessage(conn, message) {
     var info = connections[conn];
@@ -252,7 +252,7 @@
     int totalConnections, int closeStatus, String closeReason) {
   HttpServer server = new HttpServer();
 
-  server.listen("127.0.0.1", 0, totalConnections);
+  server.listen("127.0.0.1", 0, backlog: totalConnections);
 
   // Create a web socket handler and set is as the HTTP server default
   // handler.
diff --git a/tests/standalone/out_of_memory_test.dart b/tests/standalone/out_of_memory_test.dart
index 5b6d0aa..1fb36f9 100644
--- a/tests/standalone/out_of_memory_test.dart
+++ b/tests/standalone/out_of_memory_test.dart
@@ -7,7 +7,7 @@
   var exception_thrown = false;
   try {
     List<int> buf = new List<int>(number_of_ints);
-  } on OutOfMemoryException catch (exc) {
+  } on OutOfMemoryError catch (exc) {
     exception_thrown = true;
   }
   Expect.isTrue(exception_thrown);
diff --git a/tests/standalone/package/package_isolate_test.dart b/tests/standalone/package/package_isolate_test.dart
new file mode 100644
index 0000000..a94a268
--- /dev/null
+++ b/tests/standalone/package/package_isolate_test.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2012, 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 package_isolate_test;
+
+import 'package:shared.dart' as shared;
+import 'dart:isolate';
+import '../../../pkg/unittest/unittest.dart';
+
+expectResponse() {
+  port.receive(expectAsync2((msg, r) {
+    expect('isolate', msg);
+    expect('main', shared.output);
+    port.close();
+  }));
+}
+
+void main() {
+  test("package in spawnFunction()", () {
+    expectResponse();
+    shared.output = 'main';
+    var sendPort = spawnFunction(isolate_main);
+    sendPort.send("sendPort", port.toSendPort());
+  });
+  
+  test("package in spawnUri() of sibling file", () {
+    expectResponse();
+    shared.output = 'main';
+    var sendPort = spawnUri('sibling_isolate.dart');
+    sendPort.send('sendPort', port.toSendPort());
+  });
+
+  test("package in spawnUri() of file in folder", () {
+    expectResponse();
+    shared.output = 'main';
+    var sendPort = spawnUri('test_folder/folder_isolate.dart');
+    sendPort.send('sendPort', port.toSendPort());
+  });
+}
+
+void isolate_main() {
+  shared.output = 'isolate';
+  port.receive((msg, replyTo) {
+    replyTo.send(shared.output);
+  });
+}
diff --git a/tests/standalone/package/sibling_isolate.dart b/tests/standalone/package/sibling_isolate.dart
new file mode 100644
index 0000000..14b400d
--- /dev/null
+++ b/tests/standalone/package/sibling_isolate.dart
@@ -0,0 +1,17 @@
+
+// Copyright (c) 2012, 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 sibling_isolate;
+
+import 'package:shared.dart'as shared;
+import 'dart:isolate';
+
+// This file is spawned from package_isolate_test.dart
+main() {
+  shared.output = 'isolate';
+  port.receive((msg, replyTo) {
+    replyTo.send(shared.output);
+  });
+}
diff --git a/tests/standalone/package/test_folder/folder_isolate.dart b/tests/standalone/package/test_folder/folder_isolate.dart
new file mode 100644
index 0000000..9f822ce
--- /dev/null
+++ b/tests/standalone/package/test_folder/folder_isolate.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2012, 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 folder_isolate;
+
+// this is a package that's not available to the main isolate
+import 'package:folder_lib.dart' as isolate_package;
+import 'dart:isolate';
+
+// This file is spawned from package_isolate_test.dart
+main() {
+  isolate_package.count = 1;
+  port.receive((msg, replyTo) {
+    replyTo.send('isolate');
+  });
+}
diff --git a/tests/standalone/package/test_folder/packages/folder_lib.dart b/tests/standalone/package/test_folder/packages/folder_lib.dart
new file mode 100644
index 0000000..006fe71
--- /dev/null
+++ b/tests/standalone/package/test_folder/packages/folder_lib.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2012, 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 folder_lib;
+
+// This is a library that's available to folder_isolate.dart
+// but not package_isolate_test.dart
+int count = 0;
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 024ec7c..c600fda 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -50,8 +50,10 @@
 
 [ $compiler == dart2js ]
 float_array_test: Skip # This is a VM test
+int_array_test: Skip  # This is a VM test
 medium_integer_test: Fail, OK # cannot resolve type Mint
 io/process_exit_negative_test: Fail, OK # relies on a static error that is a warning now.
+package/package_isolate_test: Skip # spawnUri does not work in dart2js. See issue 3051
 
 [ $compiler == dart2js && $runtime == d8 ]
 assert_test: Fail, OK # Assumes unspecified fields on the AssertionError.
diff --git a/tests/utils/dummy_compiler_test.dart b/tests/utils/dummy_compiler_test.dart
index 129f47f..dab13b5 100644
--- a/tests/utils/dummy_compiler_test.dart
+++ b/tests/utils/dummy_compiler_test.dart
@@ -23,6 +23,7 @@
                   class String{}
                   class Function{}
                   class List {}
+                  class Map {}
                   class Closure {}
                   class Dynamic_ {}
                   class Null {}
diff --git a/tests/utils/recursive_import_test.dart b/tests/utils/recursive_import_test.dart
index 8112870..2702f67 100644
--- a/tests/utils/recursive_import_test.dart
+++ b/tests/utils/recursive_import_test.dart
@@ -17,6 +17,7 @@
 class String{}
 class Function{}
 class List {}
+class Map {}
 class Closure {}
 class Dynamic_ {}
 class Null {}
diff --git a/tests/utils/utils.status b/tests/utils/utils.status
index 2ce46b6..184160c 100644
--- a/tests/utils/utils.status
+++ b/tests/utils/utils.status
@@ -22,6 +22,10 @@
 [ $system == macos || $system == windows ]
 *_layout_test: Skip
 
+[ $compiler == dartc ]
+dummy_compiler_test: Fail # http://dartbug.com/6073
+recursive_import_test: Fail # http://dartbug.com/6073
+
 [ $compiler == dart2dart ]
 # Skip until we stabilize language tests.
 *: Skip
diff --git a/tools/VERSION b/tools/VERSION
index 87db7a4..5e26b92 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
 MAJOR 0
-MINOR 1
-BUILD 6
-PATCH 4
+MINOR 2
+BUILD 0
+PATCH 0
diff --git a/tools/build.py b/tools/build.py
index 977121d..22ecd55 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -42,7 +42,11 @@
       default=str(HOST_CPUS))
   result.add_option("--devenv",
       help='Path containing devenv.com on Windows',
-      default='C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE')
+      default='C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7'
+      '\\IDE')
+  result.add_option("--executable",
+      help='Name of the devenv.com/msbuild executable on Windows (varies for '
+      'different versions of Visual Studio)', default='devenv.com')
   return result
 
 
@@ -262,13 +266,13 @@
           if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):
             project_file = 'dart-%s.sln' % CurrentDirectoryBaseName()
           if target == 'all':
-            args = [options.devenv + os.sep + 'devenv.com',
+            args = [options.devenv + os.sep + options.executable,
                     '/build',
                     build_config,
                     project_file
                    ]
           else:
-            args = [options.devenv + os.sep + 'devenv.com',
+            args = [options.devenv + os.sep + options.executable,
                     '/build',
                     build_config,
                     '/project',
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 0543b64..0fb0d3d 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -131,6 +131,20 @@
     ReplaceInFiles([dartdoc],
                    [(r'\$BIN_DIR/\.\./\.\.', r'$BIN_DIR/..')])
 
+    # TODO(ahe): Enable for Windows as well.
+    subprocess.call([os.path.join(build_dir, 'gen_snapshot'),
+
+                     # TODO(ahe): Remove option when
+                     # http://dartbug.com/5989 is fixed.
+                     '--optimization_counter_threshold=-1',
+
+                     '--script_snapshot=%s' %
+                     os.path.join(sdk_root, 'pkg', 'compiler',
+                                  'implementation', 'dart2js.dart.snapshot'),
+                     os.path.join(sdk_root, 'pkg', 'compiler',
+                                  'implementation', 'dart2js.dart')])
+
+
 
 def Main(argv):
   # Pull in all of the gpyi files which will be munged into the sdk.
diff --git a/tools/ddbg.dart b/tools/ddbg.dart
index 24447d9..eaf0258 100644
--- a/tools/ddbg.dart
+++ b/tools/ddbg.dart
@@ -17,6 +17,7 @@
 String vmData;
 OutputStream vmStream;
 int seqNum = 0;
+int isolate_id = -1;
 
 bool verbose = false;
 
@@ -83,14 +84,20 @@
   var simple_commands =
       { 'r':'resume', 's':'stepOver', 'si':'stepInto', 'so':'stepOut'};
   if (simple_commands[command] != null) {
-    var cmd = { "id": seqNum, "command": simple_commands[command]};
+    var cmd = { "id": seqNum,
+                "command": simple_commands[command],
+                "params": { "isolateId" : isolate_id } };
     sendCmd(cmd).then((result) => handleGenericResponse(result));
     stackTrace = curFrame = null;
   } else if (command == "bt") {
-    var cmd = { "id": seqNum, "command": "getStackTrace" };
+    var cmd = { "id": seqNum,
+                "command": "getStackTrace",
+                "params": { "isolateId" : isolate_id } };
     sendCmd(cmd).then((result) => handleStackTraceResponse(result));
   } else if (command == "ll") {
-    var cmd = { "id": seqNum, "command": "getLibraries" };
+    var cmd = { "id": seqNum,
+                "command": "getLibraries",
+                "params": { "isolateId" : isolate_id } };
     sendCmd(cmd).then((result) => handleGetLibraryResponse(result));
   } else if (command == "sbp" && args.length >= 2) {
     var url, line;
@@ -103,64 +110,87 @@
     }
     var cmd = { "id": seqNum,
                 "command": "setBreakpoint",
-                "params": { "url": url, "line": line }};
+                "params": { "isolateId" : isolate_id,
+                            "url": url,
+                            "line": line }};
     sendCmd(cmd).then((result) => handleSetBpResponse(result));
   } else if (command == "rbp" && args.length == 2) {
     var cmd = { "id": seqNum,
                 "command": "removeBreakpoint",
-                "params": { "breakpointId": Math.parseInt(args[1]) }};
+                "params": { "isolateId" : isolate_id,
+                            "breakpointId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGenericResponse(result));
   } else if (command == "ls" && args.length == 2) {
     var cmd = { "id": seqNum,
                 "command": "getScriptURLs",
-                "params": { "libraryId": Math.parseInt(args[1]) }};
+                "params": { "isolateId" : isolate_id,
+                            "libraryId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGetScriptsResponse(result));
   } else if (command == "po" && args.length == 2) {
-    var cmd = { "id": seqNum, "command": "getObjectProperties",
-                "params": {"objectId": Math.parseInt(args[1]) }};
+    var cmd = { "id": seqNum,
+                "command": "getObjectProperties",
+                "params": { "isolateId" : isolate_id,
+                            "objectId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGetObjPropsResponse(result));
   } else if (command == "pl" && args.length >= 3) {
      var cmd;
      if (args.length == 3) {
-       cmd = { "id": seqNum, "command": "getListElements",
-                "params": {"objectId": Math.parseInt(args[1]),
-                            "index": Math.parseInt(args[2]) }};
+       cmd = { "id": seqNum,
+               "command": "getListElements",
+               "params": { "isolateId" : isolate_id,
+                           "objectId": Math.parseInt(args[1]),
+                           "index": Math.parseInt(args[2]) } };
     } else {
-       cmd = { "id": seqNum, "command": "getListElements",
-                "params": {"objectId": Math.parseInt(args[1]),
-                            "index": Math.parseInt(args[2]),
-                            "length": Math.parseInt(args[3]) }};
+       cmd = { "id": seqNum,
+               "command": "getListElements",
+               "params": { "isolateId" : isolate_id,
+                           "objectId": Math.parseInt(args[1]),
+                           "index": Math.parseInt(args[2]),
+                           "length": Math.parseInt(args[3]) } };
     }
     sendCmd(cmd).then((result) => handleGetListResponse(result));
   } else if (command == "pc" && args.length == 2) {
-    var cmd = { "id": seqNum, "command": "getClassProperties",
-                "params": {"classId": Math.parseInt(args[1]) }};
+    var cmd = { "id": seqNum,
+                "command": "getClassProperties",
+                "params": { "isolateId" : isolate_id,
+                            "classId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGetClassPropsResponse(result));
   } else if (command == "plib" && args.length == 2) {
-    var cmd = { "id": seqNum, "command": "getLibraryProperties",
-                "params": {"libraryId": Math.parseInt(args[1]) }};
+    var cmd = { "id": seqNum,
+                "command": "getLibraryProperties",
+                "params": {"isolateId" : isolate_id,
+                           "libraryId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGetLibraryPropsResponse(result));
   } else if (command == "slib" && args.length == 3) {
-    var cmd = { "id": seqNum, "command": "setLibraryProperties",
-                "params": {"libraryId": Math.parseInt(args[1]),
-                           "debuggingEnabled": args[2] }};
+    var cmd = { "id": seqNum,
+                "command": "setLibraryProperties",
+                "params": {"isolateId" : isolate_id,
+                           "libraryId": Math.parseInt(args[1]),
+                           "debuggingEnabled": args[2] } };
     sendCmd(cmd).then((result) => handleSetLibraryPropsResponse(result));
   } else if (command == "pg" && args.length == 2) {
-    var cmd = { "id": seqNum, "command": "getGlobalVariables",
-                "params": {"libraryId": Math.parseInt(args[1]) }};
+    var cmd = { "id": seqNum,
+                "command": "getGlobalVariables",
+                "params": { "isolateId" : isolate_id,
+                            "libraryId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGetGlobalVarsResponse(result));
   } else if (command == "gs" && args.length == 3) {
-    var cmd = { "id": seqNum, "command":  "getScriptSource",
-                "params": { "libraryId": Math.parseInt(args[1]),
-                            "url": args[2] }};
+    var cmd = { "id": seqNum,
+                "command":  "getScriptSource",
+                "params": { "isolateId" : isolate_id,
+                            "libraryId": Math.parseInt(args[1]),
+                            "url": args[2] } };
     sendCmd(cmd).then((result) => handleGetSourceResponse(result));
   } else if (command == "epi" && args.length == 2) {
-    var cmd = { "id": seqNum, "command":  "setPauseOnException",
-                "params": { "exceptions": args[1] }};
+    var cmd = { "id": seqNum,
+                "command":  "setPauseOnException",
+                "params": { "isolateId" : isolate_id,
+                            "exceptions": args[1] } };
     sendCmd(cmd).then((result) => handleGenericResponse(result));
   } else if (command == "i" && args.length == 2) {
-    var cmd = { "id": seqNum, "command": "interrupt",
-                "params": {"isolateId": Math.parseInt(args[1]) }};
+    var cmd = { "id": seqNum,
+                "command": "interrupt",
+                "params": { "isolateId": Math.parseInt(args[1]) } };
     sendCmd(cmd).then((result) => handleGenericResponse(result));
   } else if (command == "q") {
     quitShell();
@@ -361,19 +391,19 @@
 void handlePausedEvent(msg) {
   assert(msg["params"] != null);
   var reason = msg["params"]["reason"];
-  var id = msg["params"]["id"];
+  isolate_id = msg["params"]["id"];
   stackTrace = msg["params"]["callFrames"];
   assert(stackTrace != null);
   assert(stackTrace.length >= 1);
   curFrame = stackTrace[0];
   if (reason == "breakpoint") {
-    print("Isolate $id paused on breakpoint");
+    print("Isolate $isolate_id paused on breakpoint");
   } else if (reason == "interrupted") {
-    print("Isolate $id paused due to an interrupt");
+    print("Isolate $isolate_id paused due to an interrupt");
   } else {
     assert(reason == "exception");
     var excObj = msg["params"]["exception"];
-    print("Isolate $id paused on exception");
+    print("Isolate $isolate_id paused on exception");
     print(remoteObject(excObj));
   }
   print("Stack trace:");
diff --git a/tools/get_archive.py b/tools/get_archive.py
index cfbfec3..8585703 100755
--- a/tools/get_archive.py
+++ b/tools/get_archive.py
@@ -155,7 +155,7 @@
         # Test to ensure this URL exists because the dartium-archive builds can
         # have unusual numbering (a range of CL numbers) sometimes.
         result, out = Gsutil('ls', permanent_prefix % {'osname' : osname,
-            'num1': '*', 'num2': revision_num })
+            'num1': revision_num, 'num2': '*' })
         if result == 0:
           # First try to find one with the the second number the same as the
           # requested number.
diff --git a/tools/gyp_dart.py b/tools/gyp_dart.py
index c5dc0a2..200fbd5 100644
--- a/tools/gyp_dart.py
+++ b/tools/gyp_dart.py
@@ -22,9 +22,9 @@
           '-Idart/tools/gyp/all.gypi', 'dart/dart.gyp']
 
   if sys.platform == 'win32':
-    # Generate Visual Studio 2008 compatible files by default.
+    # Generate Visual Studio 2010 compatible files by default.
     if not os.environ.get('GYP_MSVS_VERSION'):
-      args.extend(['-G', 'msvs_version=2008'])
+      args.extend(['-G', 'msvs_version=2010'])
 
   sys.exit(execute(args))
 
diff --git a/tools/testing/dart/co19_test.dart b/tools/testing/dart/co19_test.dart
index 70495fb..39a1224 100644
--- a/tools/testing/dart/co19_test.dart
+++ b/tools/testing/dart/co19_test.dart
@@ -59,11 +59,8 @@
   var listTests = firstConfiguration['list'];
 
   var configurationIterator = configurations.iterator();
-  bool enqueueConfiguration(ProcessQueue queue) {
-    if (!configurationIterator.hasNext()) {
-      return false;
-    }
-
+  void enqueueConfiguration(ProcessQueue queue) {
+    if (!configurationIterator.hasNext()) return;
     var configuration = configurationIterator.next();
     for (String selector in selectors.getKeys()) {
       if (selector == 'co19') {
@@ -72,7 +69,6 @@
         throw 'Error: unexpected selector: "$selector".';
       }
     }
-    return true;
   }
 
   // Start process queue.
diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart
index af1e50a..ace2b4d 100644
--- a/tools/testing/dart/test_options.dart
+++ b/tools/testing/dart/test_options.dart
@@ -74,7 +74,7 @@
 
    dart2js: Compile dart code to JavaScript by running dart2js.
          (only valid with the following runtimes: d8, drt, chrome,
-         safari, ie, firefox, opera, none (compile only)),
+         safari, ie9, firefox, opera, none (compile only)),
 
    dartc: Perform static analysis on Dart code by running dartc.
           (only valid with the following runtimes: none)''',
@@ -95,14 +95,14 @@
 
     dartium: Run Dart or JavaScript in Dartium.
 
-    [ff | chrome | safari | ie | opera]: Run JavaScript in the specified
+    [ff | chrome | safari | ie9 | opera]: Run JavaScript in the specified
          browser.
 
     none: No runtime, compile only (for example, used for dartc static analysis
           tests).''',
               ['-r', '--runtime'],
               ['vm', 'd8', 'jsshell', 'drt', 'dartium', 'ff', 'firefox',
-               'chrome', 'safari', 'ie', 'opera', 'none'],
+               'chrome', 'safari', 'ie9', 'opera', 'none'],
               'vm'),
           new _TestOptionSpecification(
               'arch',
@@ -398,7 +398,7 @@
         // dart2js_drt will be duplicating work. If later we don't need 'none'
         // with dart2js, we should remove it from here.
         validRuntimes = const ['d8', 'jsshell', 'drt', 'none', 'dartium',
-                               'ff', 'chrome', 'safari', 'ie', 'opera'];
+                               'ff', 'chrome', 'safari', 'ie9', 'opera'];
         break;
       case 'dartc':
         validRuntimes = const ['none'];
@@ -413,7 +413,7 @@
       print("Warning: combination of ${config['compiler']} and "
           "${config['runtime']} is invalid. Skipping this combination.");
     }
-    if (config['runtime'] == 'ie' &&
+    if (config['runtime'] == 'ie9' &&
         Platform.operatingSystem != 'windows') {
       isValid = false;
       print("Warning cannot run Internet Explorer on non-Windows operating"
@@ -560,7 +560,7 @@
             timeout *= 2;
           }
           if (Contains(configuration['runtime'],
-                       const ['ie', 'ff', 'chrome', 'safari', 'opera'])) {
+                       const ['ie9', 'ff', 'chrome', 'safari', 'opera'])) {
             timeout *= 8; // Allow additional time for browser testing to run.
           }
           break;
diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart
index 81bfab1..0147663 100644
--- a/tools/testing/dart/test_progress.dart
+++ b/tools/testing/dart/test_progress.dart
@@ -406,13 +406,32 @@
     configs.add(test.configurationString);
   }
 
+  String _extractRuntime(String configuration) {
+    // Extract runtime from a configuration, for example,
+    // 'none-vm-checked release_ia32'.
+    List<String> runtime = configuration.split(' ')[0].split('-');
+    return '${runtime[0]}-${runtime[1]}';
+  }
+
   void _printFailureSummary() {
     Map<String, List<String>> groupedStatuses = new Map<String, List<String>>();
     statusToConfigs.forEach((String status, List<String> configs) {
-      configs.sort((a, b) => a.compareTo(b));
-      List<String> statuses =
-          groupedStatuses.putIfAbsent('$configs', () => <String>[]);
-      statuses.add(status);
+      Map<String, List<String>> runtimeToConfiguration =
+          new Map<String, List<String>>();
+      for (String config in configs) {
+        String runtime = _extractRuntime(config);
+        List<String> runtimeConfigs =
+            runtimeToConfiguration.putIfAbsent(runtime, () => <String>[]);
+        runtimeConfigs.add(config);
+      }
+      runtimeToConfiguration.forEach((String runtime,
+                                      List<String> runtimeConfigs) {
+        runtimeConfigs.sort((a, b) => a.compareTo(b));
+        List<String> statuses =
+            groupedStatuses.putIfAbsent('$runtime: $runtimeConfigs',
+                                        () => <String>[]);
+        statuses.add(status);
+      });
     });
     groupedStatuses.forEach((String config, List<String> statuses) {
       print('');
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 4d8917b..42d2323 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -22,7 +22,7 @@
 
 typedef void TestCaseEvent(TestCase testCase);
 typedef void ExitCodeEvent(int exitCode);
-typedef bool EnqueueMoreWork(ProcessQueue queue);
+typedef void EnqueueMoreWork(ProcessQueue queue);
 
 /** A command executed as a step in a test case. */
 class Command {
@@ -77,6 +77,7 @@
   String displayName;
   TestOutput output;
   bool isNegative;
+  bool usesWebDriver;
   Set<String> expectedOutcomes;
   TestCaseEvent completedHandler;
   TestInformation info;
@@ -87,7 +88,8 @@
            this.completedHandler,
            this.expectedOutcomes,
            {this.isNegative: false,
-            this.info: null}) {
+            this.info: null,
+            this.usesWebDriver: false}) {
     if (!isNegative) {
       this.isNegative = displayName.contains("negative_test");
     }
@@ -165,10 +167,6 @@
   List<String> get batchTestArguments => commands.last().arguments;
 
   void completed() { completedHandler(this); }
-
-  bool get usesWebDriver => Contains(
-      configuration['runtime'],
-      const ['chrome', 'dartium', 'ff', 'safari', 'ie', 'opera']);
 }
 
 
@@ -609,19 +607,27 @@
    */
   void stepExitHandler(int exitCode) {
     process.close();
+    process = null;
     int totalSteps = testCase.commands.length;
     String suffix =' (step $currentStep of $totalSteps)';
-    if (currentStep == totalSteps) { // done with test command
+    if (timedOut) {
+      // Test timed out before it could complete.
+      testComplete(0, true);
+    } else if (currentStep == totalSteps) {
+      // Done with all test commands.
       testComplete(exitCode, false);
     } else if (exitCode != 0) {
+      // One of the steps failed.
       stderr.add('test.dart: Compilation failed$suffix, exit code $exitCode\n');
       testComplete(exitCode, true);
     } else {
+      // One compilation step successfully completed, move on to the
+      // next step.
       stderr.add('test.dart: Compilation finished $suffix\n');
       stdout.add('test.dart: Compilation finished $suffix\n');
       if (currentStep == totalSteps - 1 && testCase.usesWebDriver &&
           !testCase.configuration['noBatch']) {
-        // Note: processQueue will always be non-null for runtime == ie, ff,
+        // Note: processQueue will always be non-null for runtime == ie9, ff,
         // safari, chrome, opera. (It is only null for runtime == vm)
         // This RunningProcess object is done, and hands over control to
         // BatchRunner.startTest(), which handles reporting, etc.
@@ -656,31 +662,36 @@
   }
 
   void runCommand(Command command, void exitHandler(int exitCode)) {
-    process = Process.start(command.executable, command.arguments);
-    process.onExit = exitHandler;
-    process.onError = (e) {
-      print("Error starting process:");
+    Future processFuture = Process.start(command.executable, command.arguments);
+    processFuture.then((Process p) {
+      process = p;
+      process.onExit = exitHandler;
+      var stdoutStringStream = new StringInputStream(process.stdout);
+      var stderrStringStream = new StringInputStream(process.stderr);
+      stdoutStringStream.onLine =
+          makeReadHandler(stdoutStringStream, stdout);
+      stderrStringStream.onLine =
+          makeReadHandler(stderrStringStream, stderr);
+      if (timeoutTimer == null) {
+        // Create one timeout timer when starting test case, remove it at end.
+        timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
+      }
+      // If the timeout fired in between two commands, kill the just
+      // started process immediately.
+      if (timedOut) process.kill();
+    });
+    processFuture.handleException((e) {
+      print("Process error:");
       print("  Command: $command");
       print("  Error: $e");
       testComplete(-1, false);
-    };
-    InputStream stdoutStream = process.stdout;
-    InputStream stderrStream = process.stderr;
-    StringInputStream stdoutStringStream = new StringInputStream(stdoutStream);
-    StringInputStream stderrStringStream = new StringInputStream(stderrStream);
-    stdoutStringStream.onLine =
-        makeReadHandler(stdoutStringStream, stdout);
-    stderrStringStream.onLine =
-        makeReadHandler(stderrStringStream, stderr);
-    if (timeoutTimer == null) {
-      // Create one timeout timer when starting test case, remove it at end.
-      timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
-    }
+      return true;
+    });
   }
 
   void timeoutHandler(Timer unusedTimer) {
     timedOut = true;
-    process.kill();
+    if (process != null) process.kill();
   }
 }
 
@@ -901,7 +912,7 @@
         _stderrDrained = true;
         _stdoutDrained = true;
         _process.close();
-        _startProcess(() { _reportResult(); });
+        _startProcess(_reportResult);
       } else {  // No active test case running.
         _process.close();
         _process = null;
@@ -915,21 +926,25 @@
     _process.kill();
   }
 
-  void _startProcess(then) {
-    _process = Process.start(_executable, _batchArguments);
-    _stdoutStream = new StringInputStream(_process.stdout);
-    _stderrStream = new StringInputStream(_process.stderr);
-    _process.onExit = makeExitHandler(">>> TEST CRASH");
-    _process.onError = (e) {
-      print("Error starting process:");
+  _startProcess(callback) {
+    Future processFuture = Process.start(_executable, _batchArguments);
+    processFuture.then((Process p) {
+      _process = p;
+      _stdoutStream = new StringInputStream(_process.stdout);
+      _stderrStream = new StringInputStream(_process.stderr);
+      _process.onExit = makeExitHandler(">>> TEST CRASH");
+      callback();
+    });
+    processFuture.handleException((e) {
+      print("Process error:");
       print("  Command: $_executable ${Strings.join(_batchArguments, ' ')}");
       print("  Error: $e");
       // If there is an error starting a batch process, chances are that
       // it will always fail. So rather than re-trying a 1000+ times, we
       // exit.
       exit(1);
-    };
-    _process.onStart = then;
+      return true;
+    });
   }
 }
 
@@ -1078,29 +1093,34 @@
         cmd = 'tasklist';
         arg.add('/v');
       }
-      Process p = Process.start(cmd, arg);
-      final StringInputStream stdoutStringStream =
-          new StringInputStream(p.stdout);
-      p.onError = (e) {
+
+      Future processFuture = Process.start(cmd, arg);
+      processFuture.then((Process p) {
+        final StringInputStream stdoutStringStream =
+            new StringInputStream(p.stdout);
+        stdoutStringStream.onLine = () {
+          var line = stdoutStringStream.readLine();
+          while (null != line) {
+            var regexp = const RegExp(r".*selenium-server-standalone.*");
+            if (regexp.hasMatch(line)) {
+              _seleniumAlreadyRunning = true;
+              resumeTesting();
+            }
+            line = stdoutStringStream.readLine();
+          }
+          if (!_isSeleniumAvailable) {
+            _startSeleniumServer();
+          }
+        };
+      });
+      processFuture.handleException((e) {
         print("Error starting process:");
         print("  Command: $cmd ${Strings.join(arg, ' ')}");
         print("  Error: $e");
         // TODO(ahe): How to report this as a test failure?
         exit(1);
-      };
-      stdoutStringStream.onLine = () {
-        var line = stdoutStringStream.readLine();
-        while (null != line) {
-          if (const RegExp(r".*selenium-server-standalone.*").hasMatch(line)) {
-            _seleniumAlreadyRunning = true;
-            resumeTesting();
-          }
-          line = stdoutStringStream.readLine();
-        }
-        if (!_isSeleniumAvailable) {
-          _startSeleniumServer();
-        }
-      };
+        return true;
+      });
     }
   }
 
@@ -1149,26 +1169,30 @@
     lister.onFile = (String file) {
       if (const RegExp(r"selenium-server-standalone-.*\.jar").hasMatch(file)
           && _seleniumServer == null) {
-        _seleniumServer = Process.start('java', ['-jar', file]);
-        _seleniumServer.onError = (e) {
-          print("Error starting process:");
+        Future processFuture = Process.start('java', ['-jar', file]);
+        processFuture.then((Process server) {
+          _seleniumServer = server;
+          // Heads up: there seems to an obscure data race of some form in
+          // the VM between launching the server process and launching the test
+          // tasks that disappears when you read IO (which is convenient, since
+          // that is our condition for knowing that the server is ready).
+          StringInputStream stdoutStringStream =
+              new StringInputStream(_seleniumServer.stdout);
+          StringInputStream stderrStringStream =
+              new StringInputStream(_seleniumServer.stderr);
+          stdoutStringStream.onLine =
+              makeSeleniumServerHandler(stdoutStringStream);
+          stderrStringStream.onLine =
+              makeSeleniumServerHandler(stderrStringStream);
+        });
+        processFuture.handleException((e) {
+          print("Process error:");
           print("  Command: java -jar $file");
           print("  Error: $e");
           // TODO(ahe): How to report this as a test failure?
           exit(1);
-        };
-        // Heads up: there seems to an obscure data race of some form in
-        // the VM between launching the server process and launching the test
-        // tasks that disappears when you read IO (which is convenient, since
-        // that is our condition for knowing that the server is ready).
-        StringInputStream stdoutStringStream =
-            new StringInputStream(_seleniumServer.stdout);
-        StringInputStream stderrStringStream =
-            new StringInputStream(_seleniumServer.stderr);
-        stdoutStringStream.onLine =
-            makeSeleniumServerHandler(stdoutStringStream);
-        stderrStringStream.onLine =
-            makeSeleniumServerHandler(stderrStringStream);
+          return true;
+        });
       }
     };
   }
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 3ada3b7..a5f42a5 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -65,31 +65,36 @@
 
 void ccTestLister() {
   port.receive((String runnerPath, SendPort replyTo) {
-    var p = Process.start(runnerPath, ["--list"]);
-    StringInputStream stdoutStream = new StringInputStream(p.stdout);
-    List<String> tests = new List<String>();
-    stdoutStream.onLine = () {
-      String line = stdoutStream.readLine();
-      while (line != null) {
-        tests.add(line);
-        line = stdoutStream.readLine();
-      }
-    };
-    p.onError = (error) {
+    void processErrorHandler(error) {
+    }
+    Future processFuture = Process.start(runnerPath, ["--list"]);
+    processFuture.then((p) {
+      StringInputStream stdoutStream = new StringInputStream(p.stdout);
+      List<String> tests = new List<String>();
+      stdoutStream.onLine = () {
+        String line = stdoutStream.readLine();
+        while (line != null) {
+          tests.add(line);
+          line = stdoutStream.readLine();
+        }
+      };
+      p.onExit = (code) {
+        if (code < 0) {
+          print("Failed to list tests: $runnerPath --list");
+          replyTo.send("");
+        }
+        for (String test in tests) {
+          replyTo.send(test);
+        }
+        replyTo.send("");
+      };
+      port.close();
+    });
+    processFuture.handleException((e) {
       print("Failed to list tests: $runnerPath --list");
       replyTo.send("");
-    };
-    p.onExit = (code) {
-      if (code < 0) {
-        print("Failed to list tests: $runnerPath --list");
-        replyTo.send("");
-      }
-      for (String test in tests) {
-        replyTo.send(test);
-      }
-      replyTo.send("");
-    };
-    port.close();
+      return true;
+    });
   });
 }
 
@@ -150,7 +155,8 @@
                           [new Command(runnerPath, args)],
                           configuration,
                           completeHandler,
-                          expectations));
+                          expectations,
+                          usesWebDriver: TestUtils.usesWebDriver));
     }
   }
 
@@ -224,8 +230,8 @@
                     this.suiteName,
                     Path suiteDirectory,
                     this.statusFilePaths,
-                    [this.isTestFilePredicate,
-                    bool recursive = false])
+                    {this.isTestFilePredicate,
+                    bool recursive: false})
   : dartDir = TestUtils.dartDir(), _listRecursive = recursive,
     suiteDir = TestUtils.dartDir().join(suiteDirectory);
 
@@ -263,7 +269,7 @@
     return new StandardTestSuite(configuration,
         name, directory,
         ['$directory/$name.status', '$directory/${name}_dart2js.status'],
-        (filename) => filename.endsWith('_test.dart'),
+        isTestFilePredicate: (filename) => filename.endsWith('_test.dart'),
         recursive: true);
   }
 
@@ -452,7 +458,8 @@
                           completeHandler,
                           expectations,
                           isNegative: isNegative,
-                          info: info));
+                          info: info,
+                          usesWebDriver: TestUtils.usesWebDriver));
     }
   }
 
@@ -662,12 +669,14 @@
         expectedOutput = txtPath;
         content = getHtmlLayoutContents(scriptType, '$filePrefix$scriptPath');
       } else {
+        final htmlLocation = new Path.fromNative(htmlPath);
         content = getHtmlContents(
           filename,
-          '$filePrefix${dartDir.append("pkg/unittest/test_controller.js")}',
-          '$filePrefix${dartDir.append("client/dart.js")}',
+          dartDir.append('pkg/unittest/test_controller.js')
+              .relativeTo(htmlLocation),
+          dartDir.append('client/dart.js').relativeTo(htmlLocation),
           scriptType,
-          '$filePrefix$scriptPath');
+          new Path.fromNative(scriptPath).relativeTo(htmlLocation));
       }
       htmlTest.writeStringSync(content);
       htmlTest.closeSync();
@@ -695,8 +704,7 @@
 
       // Construct the command that executes the browser test
       List<String> args;
-      if (runtime == 'ie' || runtime == 'ff' || runtime == 'chrome' ||
-          runtime == 'safari' || runtime == 'opera' || runtime == 'dartium') {
+      if (TestUtils.usesWebDriver(runtime)) {
         args = [dartDir.append('tools/testing/run_selenium.py').toNativePath(),
             '--browser=$runtime',
             '--timeout=${configuration["timeout"] - 2}',
@@ -1202,7 +1210,8 @@
                         [new Command('java', args)],
                         updatedConfiguration,
                         completeHandler,
-                        new Set<String>.from([PASS])));
+                        new Set<String>.from([PASS]),
+                        usesWebDriver: TestUtils.usesWebDriver));
     doDone();
   }
 
@@ -1408,15 +1417,16 @@
     return '$jsshellDir/$executable';
   }
 
-  static bool isBrowserRuntime(String runtime) => Contains(
-      runtime,
-      const <String>['drt',
-                     'dartium',
-                     'ie',
-                     'safari',
-                     'opera',
-                     'chrome',
-                     'ff']);
+  static bool usesWebDriver(String runtime) => Contains(
+      runtime, const <String>['dartium',
+                              'ie9',
+                              'safari',
+                              'opera',
+                              'chrome',
+                              'ff']);
+
+  static bool isBrowserRuntime(String runtime) =>
+      runtime == 'drt' || TestUtils.usesWebDriver(runtime);
 
   static bool isJsCommandLineRuntime(String runtime) =>
       Contains(runtime, const <String>['d8', 'jsshell']);
diff --git a/tools/testing/run_selenium.py b/tools/testing/run_selenium.py
index eb49b28..15162ff 100755
--- a/tools/testing/run_selenium.py
+++ b/tools/testing/run_selenium.py
@@ -173,7 +173,7 @@
     xpi = os.path.join(script_dir, 'extensions', 'firefox',                               'ConsoleCollector.xpi')
     profile.add_extension(xpi);
     return selenium.webdriver.Firefox(firefox_profile=profile)
-  elif browser == 'ie' and platform.system() == 'Windows':
+  elif browser == 'ie9' and platform.system() == 'Windows':
     return selenium.webdriver.Ie()
   elif browser == 'safari' and platform.system() == 'Darwin':
     # TODO(efortuna): Ensure our preferences (no pop-up blocking) file is the
diff --git a/tools/utils/vim/syntax/dart.vim b/tools/utils/vim/syntax/dart.vim
index 4e37f4b..ab3516b 100644
--- a/tools/utils/vim/syntax/dart.vim
+++ b/tools/utils/vim/syntax/dart.vim
@@ -34,7 +34,7 @@
 syn keyword dartStatement      return
 syn keyword dartStorageClass   static abstract
 syn keyword dartExceptions     throw try catch finally
-syn keyword dartExceptions     FormatException ClosureArgumentMismatchException EmptyQueueException Exception ExpectException FutureAlreadyCompleteException FutureNotCompleteException IllegalAccessException ArgumentError IllegalJSRegExpException IndexOutOfRangeException IntegerDivisionByZeroException NoMoreElementsException NoSuchMethodError NotImplementedException NullPointerException ObjectNotClosureException OutOfMemoryException StackOverflowException UnsupportedOperationException WrongArgumentCountException
+syn keyword dartExceptions     FormatException ClosureArgumentMismatchException EmptyQueueException Exception ExpectException FutureAlreadyCompleteException FutureNotCompleteException IllegalAccessException ArgumentError IllegalJSRegExpException IndexOutOfRangeException IntegerDivisionByZeroException NoMoreElementsException NoSuchMethodError NotImplementedException NullPointerException ObjectNotClosureException OutOfMemoryError StackOverflowException UnsupportedOperationException WrongArgumentCountException
 syn keyword dartExceptions_DEPRECATED     BadNumberFormatException
 syn keyword dartAssert         assert
 syn keyword dartClassDecl      extends implements interface
diff --git a/utils/apidoc/html_diff.dart b/utils/apidoc/html_diff.dart
index 243886d..6fd785f 100644
--- a/utils/apidoc/html_diff.dart
+++ b/utils/apidoc/html_diff.dart
@@ -73,7 +73,7 @@
     _mirrors = _compilation.mirrors;
   }
 
-  HtmlDiff([bool printWarnings = false]) :
+  HtmlDiff({bool printWarnings: false}) :
     _printWarnings = printWarnings,
     htmlToDom = new Map<String, Set<String>>(),
     htmlTypesToDom = new Map<String, Set<String>>(),
diff --git a/utils/compiler/build_helper.dart b/utils/compiler/build_helper.dart
index 9e29f84..6821599 100644
--- a/utils/compiler/build_helper.dart
+++ b/utils/compiler/build_helper.dart
@@ -116,7 +116,14 @@
     COLORS="--enable-diagnostic-colors"
   fi
 fi
-exec "\$BIN_DIR"/dart$options "\$BIN_DIR/$path" \$COLORS "\$@"
+
+unset SNAPSHOT
+if test -f "\$BIN_DIR/${path}.snapshot"; then
+  # TODO(ahe): Remove the following line when we are relatively sure it works.
+  echo Using snapshot "\$BIN_DIR/${path}.snapshot" 1>&2
+  SNAPSHOT="--use_script_snapshot=\$BIN_DIR/${path}.snapshot"
+fi
+exec "\$BIN_DIR"/dart$options \$SNAPSHOT "\$BIN_DIR/$path" \$COLORS "\$@"
 ''',
 '''
 @echo off
diff --git a/utils/compiler/buildbot.py b/utils/compiler/buildbot.py
index a66d6b0..6f326c0 100644
--- a/utils/compiler/buildbot.py
+++ b/utils/compiler/buildbot.py
@@ -167,6 +167,8 @@
 
   user_test = os.environ.get('USER_TEST', 'no')
 
+  if runtime == 'ie':
+    runtime = 'ie9' # TODO(efortuna): Fix with issue 6003.
   cmd.extend([sys.executable,
               os.path.join(os.curdir, 'tools', 'test.py'),
               '--step_name=' + step_name,
@@ -300,7 +302,7 @@
   """Find all the firefox profiles in a particular directory and delete them."""
   for f in os.listdir(directory):
     item = os.path.join(directory, f)
-    if os.path.isdir(item) and f.startswith('tmp'):
+    if os.path.isdir(item) and (f.startswith('tmp') or f.startswith('opera')):
       subprocess.Popen('rm -rf %s' % item, shell=True)
 
 def CleanUpTemporaryFiles(system, browser):
diff --git a/utils/compiler/compiler.gyp b/utils/compiler/compiler.gyp
index d419a5f..fc83a3c 100644
--- a/utils/compiler/compiler.gyp
+++ b/utils/compiler/compiler.gyp
@@ -45,6 +45,32 @@
             '<(dart_dir)',
           ],
         },
+        {
+          'action_name': 'generate_dart2js_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../lib/_internal/libraries.dart',
+            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../lib/compiler", "../../runtime/lib"])',
+          ],
+          'outputs': [
+            '<(PRODUCT_DIR)/dart2js.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)',
+
+            # TODO(ahe): Remove option when http://dartbug.com/5989 is fixed.
+            '--optimization_counter_threshold=-1',
+
+            # Note: we don't store the snapshot in the location where
+            # the dart2js script is looking for it.  The motivation
+            # for that is to support an incremental development model
+            # for dart2js compiler engineers.  However, we install the
+            # snapshot in the proper location when building the SDK.
+            '--script_snapshot=<(PRODUCT_DIR)/dart2js.snapshot',
+            '../../lib/compiler/implementation/dart2js.dart',
+          ],
+        },
       ],
     },
   ],
diff --git a/utils/css/world.dart b/utils/css/world.dart
index 840f8e1..0886068 100644
--- a/utils/css/world.dart
+++ b/utils/css/world.dart
@@ -135,7 +135,7 @@
 
   /** [message] at [location] is about a bug in the compiler. */
   void internalError(String message,
-      [SourceSpan span, SourceSpan span1, SourceSpan span2]) {
+      {SourceSpan span, SourceSpan span1, SourceSpan span2}) {
     _message(_NO_COLOR,
         'We are sorry, but...', message, span, span1, span2, true);
   }
diff --git a/utils/pub/git.dart b/utils/pub/git.dart
index 31e8b27..80901a9 100644
--- a/utils/pub/git.dart
+++ b/utils/pub/git.dart
@@ -23,9 +23,9 @@
 
 /// Run a git process with [args] from [workingDir]. Returns the stdout as a
 /// list of strings if it succeeded. Completes to an exception if it failed.
-Future<List<String>> run(List<String> args, [String workingDir]) {
+Future<List<String>> run(List<String> args, {String workingDir}) {
   return _gitCommand.chain((git) {
-    return runProcess(git, args, workingDir);
+    return runProcess(git, args, workingDir: workingDir);
   }).transform((result) {
     if (!result.success) throw new Exception(
         'Git error. Command: git ${Strings.join(args, " ")}\n'
diff --git a/utils/pub/git_source.dart b/utils/pub/git_source.dart
index 3530de6..2a73427 100644
--- a/utils/pub/git_source.dart
+++ b/utils/pub/git_source.dart
@@ -66,7 +66,7 @@
   /**
    * Ensures [description] is a Git URL.
    */
-  void validateDescription(description, [bool fromLockFile = false]) {
+  void validateDescription(description, {bool fromLockFile: false}) {
     // A single string is assumed to be a Git URL.
     if (description is String) return;
     if (description is! Map || !description.containsKey('url')) {
@@ -147,7 +147,7 @@
    * the working tree, but instead makes the repository a local mirror of the
    * remote repository. See the manpage for `git clone` for more information.
    */
-  Future _clone(String from, String to, [bool mirror=false]) {
+  Future _clone(String from, String to, {bool mirror: false}) {
     // Git on Windows does not seem to automatically create the destination
     // directory.
     return ensureDir(to).chain((_) {
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart
index b3676b8..47cda67 100644
--- a/utils/pub/hosted_source.dart
+++ b/utils/pub/hosted_source.dart
@@ -126,7 +126,7 @@
    * given name from the default host, while a map with keys "name" and "url"
    * refers to a package with the given name from the host at the given URL.
    */
-  void validateDescription(description, [bool fromLockFile=false]) {
+  void validateDescription(description, {bool fromLockFile: false}) {
     _parseDescription(description);
   }
 
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 6981e28..8890679 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -331,7 +331,7 @@
 // TODO(rnystrom): Remove this when old style packages are no longer supported.
 // See: http://code.google.com/p/dart/issues/detail?id=4964.
 Future<File> createPackageSymlink(String name, from, to,
-    [bool isSelfLink = false]) {
+    {bool isSelfLink: false}) {
   // If from contains any Dart files at the top level (aside from build.dart)
   // we assume that means it's an old style package.
   return listDir(from).chain((contents) {
@@ -481,8 +481,8 @@
  * piped streams won't be available in the result object.
  */
 Future<PubProcessResult> runProcess(String executable, List<String> args,
-    [workingDir, Map<String, String> environment, bool pipeStdout = false,
-    bool pipeStderr = false]) {
+    {workingDir, Map<String, String> environment, bool pipeStdout: false,
+    bool pipeStderr: false}) {
   int exitCode;
 
   // TODO(rnystrom): Should dart:io just handle this?
@@ -556,8 +556,8 @@
 }
 
 /// Run a git process with [args] from [workingDir].
-Future<PubProcessResult> runGit(List<String> args, [String workingDir]) =>
-    _gitCommand.chain((git) => runProcess(git, args, workingDir));
+Future<PubProcessResult> runGit(List<String> args, {String workingDir}) =>
+    _gitCommand.chain((git) => runProcess(git, args, workingDir: workingDir));
 
 /// Returns the name of the git command-line app, or null if Git could not be
 /// found on the user's PATH.
@@ -614,20 +614,19 @@
     return _extractTarGzWindows(stream, destination);
   }
 
-  var process = Process.start("tar",
-      ["--extract", "--gunzip", "--directory", destination]);
   var completer = new Completer<int>();
-
-  process.onExit = completer.complete;
-  process.onError = completer.completeException;
-
-  // Wait for the process to be fully started before writing to its
-  // stdin stream.
-  process.onStart = () {
+  var processFuture = Process.start("tar",
+      ["--extract", "--gunzip", "--directory", destination]);
+  processFuture.then((process) {
+    process.onExit = completer.complete;
     stream.pipe(process.stdin);
     process.stdout.pipe(stdout, close: false);
     process.stderr.pipe(stderr, close: false);
-  };
+  });
+  processFuture.handleException((error) {
+    completer.completeException(error);
+    return true;
+  });
 
   return completer.future.transform((exitCode) => exitCode == 0);
 }
diff --git a/utils/pub/source.dart b/utils/pub/source.dart
index 69f476c..bb956c9 100644
--- a/utils/pub/source.dart
+++ b/utils/pub/source.dart
@@ -154,7 +154,7 @@
    * [fromLockFile] is true when the description comes from a [LockFile], to
    * allow the source to use lockfile-specific descriptions via [resolveId].
    */
-  void validateDescription(description, [bool fromLockFile=false]) {}
+  void validateDescription(description, {bool fromLockFile: false}) {}
 
   /**
    * Returns whether or not [description1] describes the same package as
diff --git a/utils/pub/version.dart b/utils/pub/version.dart
index 82bc015..98fcf72 100644
--- a/utils/pub/version.dart
+++ b/utils/pub/version.dart
@@ -41,7 +41,7 @@
   final String build;
 
   /** Creates a new [Version] object. */
-  Version(this.major, this.minor, this.patch, [String pre, this.build])
+  Version(this.major, this.minor, this.patch, {String pre, this.build})
     : preRelease = pre {
     if (major < 0) throw new ArgumentError(
         'Major version must be non-negative.');
@@ -68,7 +68,7 @@
       String preRelease = match[5];
       String build = match[8];
 
-      return new Version(major, minor, patch, preRelease, build);
+      return new Version(major, minor, patch, pre: preRelease, build: build);
     } on FormatException catch (ex) {
       throw new FormatException('Could not parse "$text".');
     }
@@ -257,8 +257,8 @@
   final bool includeMin;
   final bool includeMax;
 
-  VersionRange([this.min, this.max,
-      this.includeMin = false, this.includeMax = false]) {
+  VersionRange({this.min, this.max,
+      this.includeMin: false, this.includeMax: false}) {
     if (min != null && max != null && min > max) {
       throw new ArgumentError(
           'Minimum version ("$min") must be less than maximum ("$max").');
@@ -339,8 +339,8 @@
       }
 
       // If we got here, there is an actual range.
-      return new VersionRange(intersectMin, intersectMax,
-          intersectIncludeMin, intersectIncludeMax);
+      return new VersionRange(min: intersectMin, max: intersectMax,
+          includeMin: intersectIncludeMin, includeMax: intersectIncludeMax);
     }
 
     throw new ArgumentError(
diff --git a/utils/pub/yaml/model.dart b/utils/pub/yaml/model.dart
index 710baf6..1247a71 100644
--- a/utils/pub/yaml/model.dart
+++ b/utils/pub/yaml/model.dart
@@ -118,7 +118,7 @@
    * should be specified for a composed scalar, although `null` is a valid
    * value.
    */
-  _ScalarNode(String tagName, [String content, this.value])
+  _ScalarNode(String tagName, {String content, this.value})
    : _content = content,
      super(new _Tag.scalar(tagName));
 
diff --git a/utils/pub/yaml/parser.dart b/utils/pub/yaml/parser.dart
index 4423cf6..b3c69df 100644
--- a/utils/pub/yaml/parser.dart
+++ b/utils/pub/yaml/parser.dart
@@ -915,7 +915,7 @@
       if (!truth(c_indicator(C_DOUBLE_QUOTE))) return null;
       var contents = nb_doubleText(indent, ctx);
       if (!truth(c_indicator(C_DOUBLE_QUOTE))) return null;
-      return new _ScalarNode("!", contents);
+      return new _ScalarNode("!", content: contents);
     });
   });
 
@@ -1003,7 +1003,7 @@
       if (!truth(c_indicator(C_SINGLE_QUOTE))) return null;
       var contents = nb_singleText(indent, ctx);
       if (!truth(c_indicator(C_SINGLE_QUOTE))) return null;
-      return new _ScalarNode("!", contents);
+      return new _ScalarNode("!", content: contents);
     });
   });
 
@@ -1535,7 +1535,7 @@
     var content = l_literalContent(indent + additionalIndent, header.chomping);
     if (!truth(content)) return null;
 
-    return new _ScalarNode("!", content);
+    return new _ScalarNode("!", content: content);
   });
 
   // 171
@@ -1572,7 +1572,7 @@
     var content = l_foldedContent(indent + additionalIndent, header.chomping);
     if (!truth(content)) return null;
 
-    return new _ScalarNode("!", content);
+    return new _ScalarNode("!", content: content);
   });
 
   // 175
diff --git a/utils/template/world.dart b/utils/template/world.dart
index 333e67b..92e1ab1 100644
--- a/utils/template/world.dart
+++ b/utils/template/world.dart
@@ -126,7 +126,7 @@
 
   /** [message] at [location] is so bad we can't generate runnable code. */
   void fatal(String message,
-      [SourceSpan span, SourceSpan span1, SourceSpan span2]) {
+      {SourceSpan span, SourceSpan span1, SourceSpan span2}) {
     errors++;
     seenFatal = true;
     _message(_RED_COLOR, 'fatal: ', message,
@@ -135,7 +135,7 @@
 
   /** [message] at [location] is about a bug in the compiler. */
   void internalError(String message,
-      [SourceSpan span, SourceSpan span1, SourceSpan span2]) {
+      {SourceSpan span, SourceSpan span1, SourceSpan span2}) {
     _message(_NO_COLOR,
         'We are sorry, but...', message, span, span1, span2, true);
   }
diff --git a/utils/testrunner/layout_test_controller.dart b/utils/testrunner/layout_test_controller.dart
index 5254a24..d8864a3 100644
--- a/utils/testrunner/layout_test_controller.dart
+++ b/utils/testrunner/layout_test_controller.dart
@@ -128,167 +128,170 @@
   var url = '$baseUrl?test=$testNum';
   var stdout = new List();
   start = new Date.now();
-  var process = Process.start(drt, [url]);
-  StringInputStream stdoutStringStream = new StringInputStream(process.stdout);
-  stdoutStringStream.onLine = () {
-    if (stdoutStringStream.closed) return;
-    var line = stdoutStringStream.readLine();
-    while (null != line) {
-      stdout.add(line);
-      line = stdoutStringStream.readLine();
-    }
-  };
-  process.onExit = (exitCode) {
-    process.close();
-    if (stdout.length > 0 && stdout[stdout.length-1].startsWith('#EOF')) {
-      stdout.removeLast();
-    }
-    var done = false;
-    var i = 0;
-    var label = null;
-    var labelMarker = 'CONSOLE MESSAGE: #TEST ';
-    var contentMarker = 'layer at ';
-    while (i < stdout.length) {
-      if (label == null && stdout[i].startsWith(labelMarker)) {
-        label = stdout[i].substring(labelMarker.length);
-        if (label == 'NONEXISTENT') {
-          complete();
-        }
-      } else if (stdout[i].startsWith(contentMarker)) {
-        if (label == null) {
-          complete();
-        }
-        var expectedFileName =
-            '$sourceDir${Platform.pathSeparator}'
-            '${label.replaceAll("###", "_")
-                     .replaceAll(const RegExp("[^A-Za-z0-9]"),"_")}.txt';
-        var expected = new File(expectedFileName);
-        if (regenerate) {
-          var ostream = expected.openOutputStream(FileMode.WRITE);
-          while (i < stdout.length) {
-            ostream.writeString(stdout[i]);
-            ostream.writeString('\n');
-            i++;
-          }
-          ostream.close();
-          pass(start, label);
-        } else if (!expected.existsSync()) {
-          fail(start, label, 'No expectation file');
-        } else {
-          var lines = expected.readAsLinesSync();
-          var actualLength = stdout.length - i;
-          var compareCount = min(lines.length, actualLength);
-          var match = true;
-          for (var j = 0; j < compareCount; j++) {
-            if (lines[j] != stdout[i + j]) {
-              fail(start, label, 'Expectation differs at line ${j + 1}');
-              match = false;
-              break;
-            }
-          }
-          if (match) {
-            if (lines.length != actualLength) {
-              fail(start, label, 'Expectation file has wrong length');
-            } else {
-              pass(start, label);
-            }
-          }
-        }
-        done = true;
-        break;
+  Process.start(drt, [url]).then((process) {
+    StringInputStream stdoutStringStream =
+        new StringInputStream(process.stdout);
+    stdoutStringStream.onLine = () {
+      if (stdoutStringStream.closed) return;
+      var line = stdoutStringStream.readLine();
+      while (null != line) {
+        stdout.add(line);
+        line = stdoutStringStream.readLine();
       }
-      i++;
-    }
-    if (label != null) {
-      if (!done) error(start, label, 'Failed to parse output');
-      runTextLayoutTest(testNum + 1);
-    }
-  };
+    };
+    process.onExit = (exitCode) {
+      process.close();
+      if (stdout.length > 0 && stdout[stdout.length-1].startsWith('#EOF')) {
+        stdout.removeLast();
+      }
+      var done = false;
+      var i = 0;
+      var label = null;
+      var labelMarker = 'CONSOLE MESSAGE: #TEST ';
+      var contentMarker = 'layer at ';
+      while (i < stdout.length) {
+        if (label == null && stdout[i].startsWith(labelMarker)) {
+          label = stdout[i].substring(labelMarker.length);
+          if (label == 'NONEXISTENT') {
+            complete();
+          }
+        } else if (stdout[i].startsWith(contentMarker)) {
+          if (label == null) {
+            complete();
+          }
+          var expectedFileName =
+              '$sourceDir${Platform.pathSeparator}'
+              '${label.replaceAll("###", "_")
+                      .replaceAll(const RegExp("[^A-Za-z0-9]"),"_")}.txt';
+          var expected = new File(expectedFileName);
+          if (regenerate) {
+            var ostream = expected.openOutputStream(FileMode.WRITE);
+            while (i < stdout.length) {
+              ostream.writeString(stdout[i]);
+              ostream.writeString('\n');
+              i++;
+            }
+            ostream.close();
+            pass(start, label);
+          } else if (!expected.existsSync()) {
+            fail(start, label, 'No expectation file');
+          } else {
+            var lines = expected.readAsLinesSync();
+            var actualLength = stdout.length - i;
+            var compareCount = min(lines.length, actualLength);
+            var match = true;
+            for (var j = 0; j < compareCount; j++) {
+              if (lines[j] != stdout[i + j]) {
+                fail(start, label, 'Expectation differs at line ${j + 1}');
+                match = false;
+                break;
+              }
+            }
+            if (match) {
+              if (lines.length != actualLength) {
+                fail(start, label, 'Expectation file has wrong length');
+              } else {
+                pass(start, label);
+              }
+            }
+          }
+          done = true;
+          break;
+        }
+        i++;
+      }
+      if (label != null) {
+        if (!done) error(start, label, 'Failed to parse output');
+        runTextLayoutTest(testNum + 1);
+      }
+    };
+  });
 }
 
 runPixelLayoutTest(int testNum) {
   var url = '$baseUrl?test=$testNum';
   var stdout = new List();
   start = new Date.now();
-  var process = Process.start(drt, ["$url'-p"]);
-  ListInputStream stdoutStream = process.stdout;
-  stdoutStream.onData = () {
-    if (!stdoutStream.closed) {
-      var data = stdoutStream.read();
-      stdout.addAll(data);
-    }
-  };
-  stdoutStream.onError = (e) {
-    print(e);
-  };
-  process.onExit = (exitCode) {
-    stdout.addAll(process.stdout.read());
-    process.close();
-    var labelMarker = 'CONSOLE MESSAGE: #TEST ';
-    var contentMarker = 'Content-Length: ';
-    var eol = '\n'.charCodeAt(0);
-    var pos = -1;
-    var label = null;
-    var done = false;
-
-    while(pos < stdout.length) {
-      var idx = stdout.indexOf(eol, ++pos);
-      if (idx < 0) break;
-      StringBuffer sb = new StringBuffer();
-      for (var i = pos; i < idx; i++) {
-        sb.addCharCode(stdout[i]);
+  Process.start(drt, ["$url'-p"]).then((process) {
+    ListInputStream stdoutStream = process.stdout;
+    stdoutStream.onData = () {
+      if (!stdoutStream.closed) {
+        var data = stdoutStream.read();
+        stdout.addAll(data);
       }
-      var line = sb.toString();
+    };
+    stdoutStream.onError = (e) {
+      print(e);
+    };
+    process.onExit = (exitCode) {
+      stdout.addAll(process.stdout.read());
+      process.close();
+      var labelMarker = 'CONSOLE MESSAGE: #TEST ';
+      var contentMarker = 'Content-Length: ';
+      var eol = '\n'.charCodeAt(0);
+      var pos = -1;
+      var label = null;
+      var done = false;
 
-      if (label == null && line.startsWith(labelMarker)) {
-        label = line.substring(labelMarker.length);
-        if (label == 'NONEXISTENT') {
-          complete();
+      while(pos < stdout.length) {
+        var idx = stdout.indexOf(eol, ++pos);
+        if (idx < 0) break;
+        StringBuffer sb = new StringBuffer();
+        for (var i = pos; i < idx; i++) {
+          sb.addCharCode(stdout[i]);
         }
-      } else if (line.startsWith(contentMarker)) {
-        if (label == null) {
-          complete();
-        }
-        var len = int.parse(line.substring(contentMarker.length));
-        pos = idx + 1;
-        var expectedFileName =
-            '$sourceDir${Platform.pathSeparator}'
-            '${label.replaceAll("###","_").
-                     replaceAll(const RegExp("[^A-Za-z0-9]"),"_")}.png';
-        var expected = new File(expectedFileName);
-        if (regenerate) {
-          var ostream = expected.openOutputStream(FileMode.WRITE);
-          ostream.writeFrom(stdout, pos, len);
-          ostream.close();
-          pass(start, label);
-        } else if (!expected.existsSync()) {
-          fail(start, label, 'No expectation file');
-        } else {
-          var bytes = expected.readAsBytesSync();
-          if (bytes.length != len) {
-            fail(start, label, 'Expectation file has wrong length');
-          } else {
-            var match = true;
-            for (var j = 0; j < len; j++) {
-              if (bytes[j] != stdout[pos + j]) {
-                fail(start, label, 'Expectation differs at byte ${j + 1}');
-                match = false;
-                break;
-              }
-            }
-            if (match) pass(start, label);
+        var line = sb.toString();
+
+        if (label == null && line.startsWith(labelMarker)) {
+          label = line.substring(labelMarker.length);
+          if (label == 'NONEXISTENT') {
+            complete();
           }
+        } else if (line.startsWith(contentMarker)) {
+          if (label == null) {
+            complete();
+          }
+          var len = int.parse(line.substring(contentMarker.length));
+          pos = idx + 1;
+          var expectedFileName =
+              '$sourceDir${Platform.pathSeparator}'
+              '${label.replaceAll("###","_").
+                       replaceAll(const RegExp("[^A-Za-z0-9]"),"_")}.png';
+          var expected = new File(expectedFileName);
+          if (regenerate) {
+            var ostream = expected.openOutputStream(FileMode.WRITE);
+            ostream.writeFrom(stdout, pos, len);
+            ostream.close();
+            pass(start, label);
+          } else if (!expected.existsSync()) {
+            fail(start, label, 'No expectation file');
+          } else {
+            var bytes = expected.readAsBytesSync();
+            if (bytes.length != len) {
+              fail(start, label, 'Expectation file has wrong length');
+            } else {
+              var match = true;
+              for (var j = 0; j < len; j++) {
+                if (bytes[j] != stdout[pos + j]) {
+                  fail(start, label, 'Expectation differs at byte ${j + 1}');
+                  match = false;
+                  break;
+                }
+              }
+              if (match) pass(start, label);
+            }
+          }
+          done = true;
+          break;
         }
-        done = true;
-        break;
+        pos = idx;
       }
-      pos = idx;
-    }
-    if (label != null) {
-      if (!done) error(start, label, 'Failed to parse output');
-      runPixelLayoutTest(testNum + 1);
-    }
-  };
+      if (label != null) {
+        if (!done) error(start, label, 'Failed to parse output');
+        runPixelLayoutTest(testNum + 1);
+      }
+    };
+  });
 }
 
 void init() {
diff --git a/utils/testrunner/pipeline_utils.dart b/utils/testrunner/pipeline_utils.dart
index bfe600c..c1ecb39 100644
--- a/utils/testrunner/pipeline_utils.dart
+++ b/utils/testrunner/pipeline_utils.dart
@@ -60,38 +60,39 @@
  */
 Future _processHelper(String command, List<String> args,
     [int timeout = 300, int procId = 0, Function outputMonitor]) {
-  var completer = new Completer();
+  var completer = procId == 0 ? new Completer() : null;
   log.add('Running $command ${Strings.join(args, " ")}');
   var timer = null;
   var stdoutHandler, stderrHandler;
-  var process = Process.start(command, args);
-  if (procId != 0) {
+  var processFuture = Process.start(command, args);
+  processFuture.then((process) {
     _procs[procId] = process;
-  }
-  process.onStart = () {
+
     timer = new Timer(1000 * timeout, (t) {
       timer = null;
       process.kill();
     });
-  };
-  process.onExit = (exitCode) {
-    if (timer != null) {
-      timer.cancel();
-    }
-    process.close();
-    if (completer != null) {
-      completer.complete(exitCode);
-    }
-  };
-  process.onError = (e) {
+
+    process.onExit = (exitCode) {
+      if (timer != null) {
+        timer.cancel();
+      }
+      process.close();
+      if (completer != null) {
+        completer.complete(exitCode);
+      }
+    };
+
+    _pipeStream(process.stdout, stdout, outputMonitor);
+    _pipeStream(process.stderr, stderr, outputMonitor);
+  });
+  processFuture.handleException((e) {
     stderr.add("Error starting process:");
     stderr.add("  Command: $command");
     stderr.add("  Error: $e");
     completePipeline(-1);
-  };
-
-  _pipeStream(process.stdout, stdout, outputMonitor);
-  _pipeStream(process.stderr, stderr, outputMonitor);
+    return true;
+  });
 
   return completer.future;
 }
diff --git a/utils/tests/pub/lock_file_test.dart b/utils/tests/pub/lock_file_test.dart
index 7b14e49..e3eec8a 100644
--- a/utils/tests/pub/lock_file_test.dart
+++ b/utils/tests/pub/lock_file_test.dart
@@ -17,7 +17,7 @@
   final String name = 'mock';
   final bool shouldCache = false;
 
-  void validateDescription(String description, [bool fromLockFile=false]) {
+  void validateDescription(String description, {bool fromLockFile: false}) {
     if (!description.endsWith(' desc')) throw new FormatException();
   }
 
diff --git a/utils/tests/pub/pubspec_test.dart b/utils/tests/pub/pubspec_test.dart
index 5fa2abd..474f2af 100644
--- a/utils/tests/pub/pubspec_test.dart
+++ b/utils/tests/pub/pubspec_test.dart
@@ -14,7 +14,7 @@
 class MockSource extends Source {
   final String name = "mock";
   final bool shouldCache = false;
-  void validateDescription(description, [bool fromLockFile=false]) {
+  void validateDescription(description, {bool fromLockFile: false}) {
     if (description != 'ok') throw new FormatException('Bad');
   }
   String packageName(description) => 'foo';
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 48620b9..df6cb3e 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -513,8 +513,8 @@
  * Schedules a call to the Pub command-line utility. Runs Pub with [args] and
  * validates that its results match [output], [error], and [exitCode].
  */
-void schedulePub([List<String> args, Pattern output, Pattern error,
-    int exitCode = 0]) {
+void schedulePub({List<String> args, Pattern output, Pattern error,
+    int exitCode: 0}) {
   _schedule((sandboxDir) {
     String pathInSandbox(path) => join(getFullPath(sandboxDir), path);
 
@@ -572,9 +572,9 @@
  * A shorthand for [schedulePub] and [run] when no validation needs to be done
  * after Pub has been run.
  */
-void runPub([List<String> args, Pattern output, Pattern error,
-    int exitCode = 0]) {
-  schedulePub(args, output, error, exitCode);
+void runPub({List<String> args, Pattern output, Pattern error,
+    int exitCode: 0}) {
+  schedulePub(args: args, output: output, error: error, exitCode: exitCode);
   run();
 }
 
@@ -1136,8 +1136,7 @@
       return create(tempDir);
     }).then((tar) {
       var sourceStream = tar.openInputStream();
-      pipeInputToInput(
-          sourceStream, sinkStream, onClosed: tempDir.deleteRecursively);
+      pipeInputToInput(sourceStream, sinkStream, tempDir.deleteRecursively);
     });
     return sinkStream;
   }
diff --git a/utils/tests/pub/version_solver_test.dart b/utils/tests/pub/version_solver_test.dart
index d2033ca..dfbeda8 100644
--- a/utils/tests/pub/version_solver_test.dart
+++ b/utils/tests/pub/version_solver_test.dart
@@ -337,7 +337,7 @@
 //   can keep track of server traffic.
 }
 
-testResolve(description, packages, [lockfile, result, error]) {
+testResolve(description, packages, {lockfile, result, error}) {
   test(description, () {
     var sources = new SourceRegistry();
     source1 = new MockSource('mock1');
diff --git a/utils/tests/pub/version_test.dart b/utils/tests/pub/version_test.dart
index e82766e5..22c0ffb 100644
--- a/utils/tests/pub/version_test.dart
+++ b/utils/tests/pub/version_test.dart
@@ -94,10 +94,11 @@
       expect(v123.intersect(v114).isEmpty);
 
       // Intersecting a range returns the version if the range allows it.
-      expect(v123.intersect(new VersionRange(v114, v124)), equals(v123));
+      expect(v123.intersect(new VersionRange(min: v114, max: v124)),
+          equals(v123));
 
       // Intersecting a range allows no versions if the range doesn't allow it.
-      expect(v114.intersect(new VersionRange(v123, v124)).isEmpty);
+      expect(v114.intersect(new VersionRange(min: v123, max: v124)).isEmpty);
     });
 
     test('isEmpty', () {
@@ -149,13 +150,13 @@
   group('VersionRange', () {
     group('constructor', () {
       test('takes a min and max', () {
-        var range = new VersionRange(v123, v124);
+        var range = new VersionRange(min: v123, max: v124);
         expect(range.min, equals(v123));
         expect(range.max, equals(v124));
       });
 
       test('allows omitting max', () {
-        var range = new VersionRange(v123);
+        var range = new VersionRange(min: v123);
         expect(range.min, equals(v123));
         expect(range.max, isNull);
       });
@@ -187,13 +188,13 @@
       });
 
       test('throws if min > max', () {
-        throwsIllegalArg(() => new VersionRange(v124, v123));
+        throwsIllegalArg(() => new VersionRange(min: v124, max: v123));
       });
     });
 
     group('allows()', () {
       test('version must be greater than min', () {
-        var range = new VersionRange(v123, v234);
+        var range = new VersionRange(min: v123, max: v234);
 
         expect(!range.allows(new Version.parse('1.2.2')));
         expect(!range.allows(new Version.parse('1.2.3')));
@@ -202,7 +203,7 @@
       });
 
       test('version must be min or greater if includeMin', () {
-        var range = new VersionRange(v123, v234, includeMin: true);
+        var range = new VersionRange(min: v123, max: v234, includeMin: true);
 
         expect(!range.allows(new Version.parse('1.2.2')));
         expect(range.allows(new Version.parse('1.2.3')));
@@ -211,7 +212,7 @@
       });
 
       test('version must be less than max', () {
-        var range = new VersionRange(v123, v234);
+        var range = new VersionRange(min: v123, max: v234);
 
         expect(range.allows(new Version.parse('2.3.3')));
         expect(!range.allows(new Version.parse('2.3.4')));
@@ -219,7 +220,7 @@
       });
 
       test('version must be max or less if includeMax', () {
-        var range = new VersionRange(v123, v234, includeMax: true);
+        var range = new VersionRange(min: v123, max: v234, includeMax: true);
 
         expect(range.allows(new Version.parse('2.3.3')));
         expect(range.allows(new Version.parse('2.3.4')));
@@ -234,7 +235,7 @@
       });
 
       test('has no max if one was not set', () {
-        var range = new VersionRange(v123);
+        var range = new VersionRange(min: v123);
 
         expect(!range.allows(new Version.parse('1.2.3')));
         expect(range.allows(new Version.parse('1.3.3')));
@@ -251,8 +252,8 @@
 
     group('intersect()', () {
       test('two overlapping ranges', () {
-        var a = new VersionRange(v123, v250);
-        var b = new VersionRange(v200, v300);
+        var a = new VersionRange(min: v123, max: v250);
+        var b = new VersionRange(min: v200, max: v300);
         var intersect = a.intersect(b);
         expect(intersect.min, equals(v200));
         expect(intersect.max, equals(v250));
@@ -261,39 +262,40 @@
       });
 
       test('a non-overlapping range allows no versions', () {
-        var a = new VersionRange(v114, v124);
-        var b = new VersionRange(v200, v250);
+        var a = new VersionRange(min: v114, max: v124);
+        var b = new VersionRange(min: v200, max: v250);
         expect(a.intersect(b).isEmpty);
       });
 
       test('adjacent ranges allow no versions if exclusive', () {
-        var a = new VersionRange(v114, v124, includeMax: false);
-        var b = new VersionRange(v124, v200, includeMin: true);
+        var a = new VersionRange(min: v114, max: v124, includeMax: false);
+        var b = new VersionRange(min: v124, max: v200, includeMin: true);
         expect(a.intersect(b).isEmpty);
       });
 
       test('adjacent ranges allow version if inclusive', () {
-        var a = new VersionRange(v114, v124, includeMax: true);
-        var b = new VersionRange(v124, v200, includeMin: true);
+        var a = new VersionRange(min: v114, max: v124, includeMax: true);
+        var b = new VersionRange(min: v124, max: v200, includeMin: true);
         expect(a.intersect(b), equals(v124));
       });
 
       test('with an open range', () {
         var open = new VersionRange();
-        var a = new VersionRange(v114, v124);
+        var a = new VersionRange(min: v114, max: v124);
         expect(open.intersect(open), equals(open));
         expect(a.intersect(open), equals(a));
       });
 
       test('returns the version if the range allows it', () {
-        expect(new VersionRange(v114, v124).intersect(v123), equals(v123));
-        expect(new VersionRange(v123, v124).intersect(v114).isEmpty);
+        expect(new VersionRange(min: v114, max: v124).intersect(v123),
+            equals(v123));
+        expect(new VersionRange(min: v123, max: v124).intersect(v114).isEmpty);
       });
     });
 
     test('isEmpty', () {
       expect(new VersionRange().isEmpty, isFalse);
-      expect(new VersionRange(v123, v124).isEmpty, isFalse);
+      expect(new VersionRange(min: v123, max: v124).isEmpty, isFalse);
     });
   });