Version 1.11.0-dev.5.2

Cherry-pick fee40ca9e494cf6e854d81de3a53e37f70247241 into dev
Cherry-pick 63681d5b59a26d00233ee582e8f9b9fa63c0bd80 into dev
diff --git a/DEPS b/DEPS
index ac13736..0a901f2 100644
--- a/DEPS
+++ b/DEPS
@@ -76,7 +76,7 @@
   "oauth2_rev": "@1bff41f4d54505c36f2d1a001b83b8b745c452f5",
   "observe_rev": "@eee2b8ec34236fa46982575fbccff84f61202ac6",
   "observatory_pub_packages_rev": "@45565",
-  "package_config_tag": "@0.0.2+4",
+  "package_config_tag": "@0.0.3+1",
   "path_rev": "@93b3e2aa1db0ac0c8bab9d341588d77acda60320",
   "petitparser_rev" : "@37878",
   "ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
diff --git a/pkg/compiler/lib/compiler.dart b/pkg/compiler/lib/compiler.dart
index 3db762d..710ad44 100644
--- a/pkg/compiler/lib/compiler.dart
+++ b/pkg/compiler/lib/compiler.dart
@@ -5,6 +5,7 @@
 library compiler;
 
 import 'dart:async';
+import 'package:package_config/packages.dart';
 import 'src/apiimpl.dart';
 
 // Unless explicitly allowed, passing [:null:] for any argument to the
@@ -58,13 +59,19 @@
  * [:null:]. If [uri] is not [:null:], neither are [begin] and
  * [end]. [uri] indicates the compilation unit from where the
  * diagnostic originates. [begin] and [end] are zero-based character
- * offsets from the beginning of the compilaton unit. [message] is the
+ * offsets from the beginning of the compilation unit. [message] is the
  * diagnostic message, and [kind] indicates indicates what kind of
  * diagnostic it is.
  */
 typedef void DiagnosticHandler(Uri uri, int begin, int end,
                                String message, Diagnostic kind);
 
+/**
+ * Provides a package lookup mechanism in the case that no package root or
+ * package resolution configuration file are explicitly specified.
+ */
+typedef Future<Packages> PackagesDiscoveryProvider(Uri uri);
+
 /// Information resulting from the compilation.
 class CompilationResult {
   /// `true` if the compilation succeeded, that is, compilation didn't fail due
@@ -103,7 +110,9 @@
     DiagnosticHandler handler,
     [List<String> options = const [],
      CompilerOutputProvider outputProvider,
-     Map<String, dynamic> environment = const {}]) {
+     Map<String, dynamic> environment = const {},
+     Uri packageConfig,
+     PackagesDiscoveryProvider packagesDiscoveryProvider]) {
   if (!libraryRoot.path.endsWith("/")) {
     throw new ArgumentError("libraryRoot must end with a /");
   }
@@ -118,7 +127,9 @@
                                    libraryRoot,
                                    packageRoot,
                                    options,
-                                   environment);
+                                   environment,
+                                   packageConfig,
+                                   packagesDiscoveryProvider);
   return compiler.run(script).then((bool success) {
     return new CompilationResult(compiler, isSuccess: success);
   });
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index a9579f0..c2e9446 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -5,6 +5,7 @@
 library leg_apiimpl;
 
 import 'dart:async';
+import 'dart:convert';
 
 import '../compiler.dart' as api;
 import 'dart2jslib.dart' as leg;
@@ -13,6 +14,11 @@
 import 'package:_internal/libraries.dart' hide LIBRARIES;
 import 'package:_internal/libraries.dart' as library_info show LIBRARIES;
 import 'io/source_file.dart';
+import 'package:package_config/packages.dart';
+import 'package:package_config/packages_file.dart' as pkgs;
+import 'package:package_config/src/packages_impl.dart'
+    show NonFilePackagesDirectoryPackages, MapPackages;
+import 'package:package_config/src/util.dart' show checkValidPackageUri;
 
 const bool forceIncrementalSupport =
     const bool.fromEnvironment('DART2JS_EXPERIMENTAL_INCREMENTAL_SUPPORT');
@@ -21,7 +27,10 @@
   api.CompilerInputProvider provider;
   api.DiagnosticHandler handler;
   final Uri libraryRoot;
+  final Uri packageConfig;
   final Uri packageRoot;
+  final api.PackagesDiscoveryProvider packagesDiscoveryProvider;
+  Packages packages;
   List<String> options;
   Map<String, dynamic> environment;
   bool mockableLibraryUsed = false;
@@ -29,6 +38,7 @@
 
   leg.GenericTask userHandlerTask;
   leg.GenericTask userProviderTask;
+  leg.GenericTask userPackagesDiscoveryTask;
 
   Compiler(this.provider,
            api.CompilerOutputProvider outputProvider,
@@ -36,7 +46,9 @@
            this.libraryRoot,
            this.packageRoot,
            List<String> options,
-           this.environment)
+           this.environment,
+           [this.packageConfig,
+            this.packagesDiscoveryProvider])
       : this.options = options,
         this.allowedLibraryCategories = getAllowedLibraryCategories(options),
         super(
@@ -95,6 +107,8 @@
     tasks.addAll([
         userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
         userProviderTask = new leg.GenericTask('Input provider', this),
+        userPackagesDiscoveryTask =
+            new leg.GenericTask('Package discovery', this),
     ]);
     if (libraryRoot == null) {
       throw new ArgumentError("[libraryRoot] is null.");
@@ -102,10 +116,11 @@
     if (!libraryRoot.path.endsWith("/")) {
       throw new ArgumentError("[libraryRoot] must end with a /.");
     }
-    if (packageRoot == null) {
-      throw new ArgumentError("[packageRoot] is null.");
+    if (packageRoot != null && packageConfig != null) {
+      throw new ArgumentError("Only one of [packageRoot] or [packageConfig] "
+                              "may be given.");
     }
-    if (!packageRoot.path.endsWith("/")) {
+    if (packageRoot != null && !packageRoot.path.endsWith("/")) {
       throw new ArgumentError("[packageRoot] must end with a /.");
     }
     if (!analyzeOnly) {
@@ -159,8 +174,7 @@
 
   // TODO(johnniwinther): Merge better with [translateDartUri] when
   // [scanBuiltinLibrary] is removed.
-  String lookupLibraryPath(String dartLibraryName) {
-    LibraryInfo info = lookupLibraryInfo(dartLibraryName);
+  String lookupLibraryPath(LibraryInfo info) {
     if (info == null) return null;
     if (!info.isDart2jsLibrary) return null;
     if (!allowedLibraryCategories.contains(info.category)) return null;
@@ -224,6 +238,7 @@
     }
 
     Uri resourceUri = translateUri(node, readableUri);
+    if (resourceUri == null) return synthesizeScript(node, readableUri);
     if (resourceUri.scheme == 'dart-ext') {
       if (!allowNativeExtensions) {
         withCurrentElement(element, () {
@@ -259,12 +274,11 @@
   }
 
   Future<leg.Script> synthesizeScript(leg.Spannable node, Uri readableUri) {
-    Uri resourceUri = translateUri(node, readableUri);
     return new Future.value(
         new leg.Script(
-            readableUri, resourceUri,
+            readableUri, readableUri,
             new StringSourceFile.fromUri(
-                resourceUri,
+                readableUri,
                 "// Synthetic source file generated for '$readableUri'."),
             isSynthesized: true));
   }
@@ -284,7 +298,7 @@
   Uri translateDartUri(elements.LibraryElement importingLibrary,
                        Uri resolvedUri, tree.Node node) {
     LibraryInfo libraryInfo = lookupLibraryInfo(resolvedUri.path);
-    String path = lookupLibraryPath(resolvedUri.path);
+    String path = lookupLibraryPath(libraryInfo);
     if (libraryInfo != null &&
         libraryInfo.category == "Internal") {
       bool allowInternalLibraryAccess = false;
@@ -332,25 +346,66 @@
   }
 
   Uri translatePackageUri(leg.Spannable node, Uri uri) {
-    return packageRoot.resolve(uri.path);
+    try {
+      checkValidPackageUri(uri);
+    } on ArgumentError catch (e) {
+      reportError(
+          node,
+          leg.MessageKind.INVALID_PACKAGE_URI,
+          {'uri': uri, 'exception': e.message});
+      return null;
+    }
+    return packages.resolve(uri,
+        notFound: (Uri notFound) {
+          reportError(
+              node,
+              leg.MessageKind.LIBRARY_NOT_FOUND,
+              {'resolvedUri': uri}
+          );
+          return null;
+        });
   }
 
-  Future<bool> run(Uri uri) {
-    log('Allowed library categories: $allowedLibraryCategories');
-    return super.run(uri).then((bool success) {
-      int cumulated = 0;
-      for (final task in tasks) {
-        int elapsed = task.timing;
-        if (elapsed != 0) {
-          cumulated += elapsed;
-          log('${task.name} took ${elapsed}msec');
-        }
+  Future setupPackages(Uri uri) async {
+    if (packageRoot != null) {
+      // Use "non-file" packages because the file version requires a [Directory]
+      // and we can't depend on 'dart:io' classes.
+      packages = new NonFilePackagesDirectoryPackages(packageRoot);
+    } else if (packageConfig != null) {
+      var packageConfigContents = await provider(packageConfig);
+      if (packageConfigContents is String) {
+        packageConfigContents = UTF8.encode(packageConfigContents);
       }
-      int total = totalCompileTime.elapsedMilliseconds;
-      log('Total compile-time ${total}msec;'
-          ' unaccounted ${total - cumulated}msec');
-      return success;
-    });
+      packages =
+          new MapPackages(pkgs.parse(packageConfigContents, packageConfig));
+    } else {
+      if (packagesDiscoveryProvider == null) {
+        packages = Packages.noPackages;
+      } else {
+        packages = await callUserPackagesDiscovery(uri);
+      }
+    }
+  }
+
+  Future<bool> run(Uri uri) async {
+    log('Allowed library categories: $allowedLibraryCategories');
+
+    await setupPackages(uri);
+    assert(packages != null);
+
+    bool success = await super.run(uri);
+    int cumulated = 0;
+    for (final task in tasks) {
+      int elapsed = task.timing;
+      if (elapsed != 0) {
+        cumulated += elapsed;
+        log('${task.name} took ${elapsed}msec');
+      }
+    }
+    int total = totalCompileTime.elapsedMilliseconds;
+    log('Total compile-time ${total}msec;'
+        ' unaccounted ${total - cumulated}msec');
+    return success;
   }
 
   void reportDiagnostic(leg.Spannable node,
@@ -367,8 +422,7 @@
     if (span == null || span.uri == null) {
       callUserHandler(null, null, null, '$message', kind);
     } else {
-      callUserHandler(
-          translateUri(null, span.uri), span.begin, span.end, '$message', kind);
+      callUserHandler(span.uri, span.begin, span.end, '$message', kind);
     }
   }
 
@@ -399,6 +453,16 @@
     }
   }
 
+  Future<Packages> callUserPackagesDiscovery(Uri uri) {
+    try {
+      return userPackagesDiscoveryTask.measure(
+                 () => packagesDiscoveryProvider(uri));
+    } catch (ex, s) {
+      diagnoseCrashInUserCode('Uncaught exception in package discovery', ex, s);
+      rethrow;
+    }
+  }
+
   void diagnoseCrashInUserCode(String message, exception, stackTrace) {
     hasCrashed = true;
     print('$message: ${tryToString(exception)}');
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 3f92322..098e09c 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -19,6 +19,7 @@
 import 'util/util.dart' show stackTraceFilePrefix;
 import 'util/command_line.dart';
 import 'package:_internal/libraries.dart';
+import 'package:package_config/discovery.dart' show findPackages;
 
 const String LIBRARY_ROOT = '../../../../../sdk';
 const String OUTPUT_LANGUAGE_DART = 'Dart';
@@ -105,6 +106,7 @@
   Uri libraryRoot = currentDirectory;
   Uri out = currentDirectory.resolve('out.js');
   Uri sourceMapOut = currentDirectory.resolve('out.js.map');
+  Uri packageConfig = null;
   Uri packageRoot = null;
   List<String> options = new List<String>();
   bool explicitOut = false;
@@ -140,6 +142,10 @@
     packageRoot = currentDirectory.resolve(extractPath(argument));
   }
 
+  setPackageConfig(String argument) {
+    packageConfig = currentDirectory.resolve(extractPath(argument));
+  }
+
   setOutput(Iterator<String> arguments) {
     optionsImplyCompilation.add(arguments.current);
     String path;
@@ -329,6 +335,7 @@
                       (_) => setTrustPrimitives(
                           '--trust-primitives')),
     new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
+    new OptionHandler('--packages=.+', setPackageConfig),
     new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
     new OptionHandler('--analyze-all', setAnalyzeAll),
     new OptionHandler('--analyze-only', setAnalyzeOnly),
@@ -403,9 +410,8 @@
                 "checked mode.");
   }
 
-  Uri uri = currentDirectory.resolve(arguments[0]);
-  if (packageRoot == null) {
-    packageRoot = uri.resolve('./packages/');
+  if (packageRoot != null && packageConfig != null) {
+    helpAndFail("Cannot specify both '--package-root' and '--packages.");
   }
 
   if ((analyzeOnly || analyzeAll) && !optionsImplyCompilation.isEmpty) {
@@ -431,8 +437,6 @@
                 "combination with the '--output-type=dart' option.");
   }
 
-  diagnosticHandler.info('Package root is $packageRoot');
-
   options.add('--out=$out');
   options.add('--source-map=$sourceMapOut');
 
@@ -467,9 +471,10 @@
     return result;
   }
 
-  return compileFunc(uri, libraryRoot, packageRoot,
-                     inputProvider, diagnosticHandler,
-                     options, outputProvider, environment)
+  Uri uri = currentDirectory.resolve(arguments[0]);
+  return compileFunc(uri, libraryRoot, packageRoot, inputProvider,
+                     diagnosticHandler, options, outputProvider, environment,
+                     packageConfig, findPackages)
             .then(compilationDone);
 }
 
@@ -551,7 +556,12 @@
     Display version information.
 
   -p<path>, --package-root=<path>
-    Where to find packages, that is, "package:..." imports.
+    Where to find packages, that is, "package:..." imports.  This option cannot
+    be used with --packages.
+
+  --packages=<path>
+    Path to the package resolution configuration file, which supplies a mapping
+    of package names to paths.  This option cannot be used with --package-root.
 
   --analyze-all
     Analyze all code.  Without this option, the compiler only analyzes
diff --git a/pkg/compiler/lib/src/mirrors/analyze.dart b/pkg/compiler/lib/src/mirrors/analyze.dart
index 44bd859..8932fff 100644
--- a/pkg/compiler/lib/src/mirrors/analyze.dart
+++ b/pkg/compiler/lib/src/mirrors/analyze.dart
@@ -26,7 +26,9 @@
                              Uri packageRoot,
                              api.CompilerInputProvider inputProvider,
                              api.DiagnosticHandler diagnosticHandler,
-                             [List<String> options = const <String>[]]) {
+                             [List<String> options = const <String>[],
+                              Uri packageConfig,
+                              api.PackagesDiscoveryProvider findPackages]) {
   if (!libraryRoot.path.endsWith("/")) {
     throw new ArgumentError("libraryRoot must end with a /");
   }
@@ -54,9 +56,12 @@
   Compiler compiler = new apiimpl.Compiler(inputProvider,
                                            null,
                                            internalDiagnosticHandler,
-                                           libraryRoot, packageRoot,
+                                           libraryRoot,
+                                           packageRoot,
                                            options,
-                                           const {});
+                                           const {},
+                                           packageConfig,
+                                           findPackages);
   compiler.librariesToAnalyzeWhenRun = libraries;
   return compiler.run(null).then((bool success) {
     if (success && !compilationFailed) {
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 7af9562..9bad54e 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -1599,6 +1599,27 @@
 main() {}
 """]);
 
+  static const MessageKind INVALID_PACKAGE_URI = const MessageKind(
+      "'#{uri}' is not a valid package URI (#{exception}).",
+      howToFix: DONT_KNOW_HOW_TO_FIX,
+      examples: const [
+        """
+// can't have a 'top level' package URI
+import 'package:foo.dart';
+
+main() {}
+""", """
+// can't have 2 slashes
+import 'package://foo/foo.dart';
+
+main() {}
+""", """
+// package name must be a valid identifier
+import 'package:not-valid/foo.dart';
+
+main() {}
+"""]);
+
   static const MessageKind READ_SCRIPT_ERROR = const MessageKind(
       "Can't read '#{uri}' (#{exception}).",
       // Don't know how to fix since the underlying error is unknown.
diff --git a/pkg/dart2js_incremental/lib/caching_compiler.dart b/pkg/dart2js_incremental/lib/caching_compiler.dart
index 06445cb..0050ab0 100644
--- a/pkg/dart2js_incremental/lib/caching_compiler.dart
+++ b/pkg/dart2js_incremental/lib/caching_compiler.dart
@@ -60,7 +60,9 @@
         libraryRoot,
         packageRoot,
         options,
-        environment);
+        environment,
+        null,
+        null);
     JavaScriptBackend backend = compiler.backend;
 
     // Much like a scout, an incremental compiler is always prepared. For
diff --git a/tests/compiler/dart2js/bad_output_io_test.dart b/tests/compiler/dart2js/bad_output_io_test.dart
index 868d53c..d2429f0 100644
--- a/tests/compiler/dart2js/bad_output_io_test.dart
+++ b/tests/compiler/dart2js/bad_output_io_test.dart
@@ -55,7 +55,8 @@
 }
 
 testOutputProvider(script, libraryRoot, packageRoot, inputProvider, handler,
-                   [options, outputProvider, environment]) {
+                   [options, outputProvider, environment, packageConfig,
+                    findPackages]) {
   diagnosticHandler = new CollectingFormattingDiagnosticHandler();
   outputProvider("/non/existing/directory/should/fail/file", "js");
 }
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 82473cb..f69a271 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -34,11 +34,13 @@
                 Uri packageRoot,
                 List<String> options,
                 Map<String, dynamic> environment,
+                Uri packageConfig,
+                api.PackagesDiscoveryProvider findPackages,
                 String this.testMarker,
                 String this.testType,
                 Function this.onTest)
       : super(inputProvider, outputProvider, handler, libraryRoot,
-              packageRoot, options, environment) {
+              packageRoot, options, environment, packageConfig, findPackages) {
     scanner = new TestScanner(this);
     resolver = new TestResolver(this, backend.constantCompilerTask);
     test('Compiler');
@@ -156,7 +158,9 @@
         api.DiagnosticHandler handler,
         [List<String> options = const [],
          api.CompilerOutputProvider outputProvider,
-         Map<String, dynamic> environment = const {}]) {
+         Map<String, dynamic> environment = const {},
+         Uri packageConfig,
+         api.PackagesDiscoveryProvider findPackages]) {
       libraryRoot = Platform.script.resolve('../../../sdk/');
       outputProvider = NullSink.outputProvider;
       // Use this to silence the test when debugging:
@@ -168,6 +172,8 @@
                                            packageRoot,
                                            options,
                                            environment,
+                                           packageConfig,
+                                           findPackages,
                                            marker,
                                            type,
                                            onTest);
diff --git a/tests/compiler/dart2js/expect_annotations_test.dart b/tests/compiler/dart2js/expect_annotations_test.dart
index 6669d32..8613107 100644
--- a/tests/compiler/dart2js/expect_annotations_test.dart
+++ b/tests/compiler/dart2js/expect_annotations_test.dart
@@ -49,7 +49,7 @@
 
 main() {
   Compiler compiler = compilerFor(MEMORY_SOURCE_FILES);
-  asyncTest(() => compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
+  asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
     Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation');
     JavaScriptBackend backend = compiler.backend;
     Expect.isNotNull(backend.annotations.expectNoInlineClass,
diff --git a/tests/compiler/dart2js/import_mirrors_test.dart b/tests/compiler/dart2js/import_mirrors_test.dart
index cbe044b..f5f799b 100644
--- a/tests/compiler/dart2js/import_mirrors_test.dart
+++ b/tests/compiler/dart2js/import_mirrors_test.dart
@@ -66,16 +66,16 @@
 main() {}

 ''',

   '/first.dart': '''

-import 'package:second.dart';

+import 'package:second/second.dart';

 ''',

-  '/pkg/second.dart': '''

+  '/pkg/second/second.dart': '''

 import 'dart:mirrors';

 ''',

 

   'paths':

-      "first.dart => package:second.dart => dart:mirrors",

+      "first.dart => package:second => dart:mirrors",

   'verbosePaths':

-      "main.dart => first.dart => package:second.dart => dart:mirrors",

+      "main.dart => first.dart => package:second/second.dart => dart:mirrors",

 };

 

 const INDIRECT_PACKAGE_IMPORT2 = const {

@@ -85,16 +85,16 @@
 main() {}

 ''',

   '/first.dart': '''

-import 'package:package-name/second.dart';

+import 'package:packagename/second.dart';

 ''',

-  '/pkg/package-name/second.dart': '''

+  '/pkg/packagename/second.dart': '''

 import 'dart:mirrors';

 ''',

 

   'paths':

-      "first.dart => package:package-name => dart:mirrors",

+      "first.dart => package:packagename => dart:mirrors",

   'verbosePaths':

-      "main.dart => first.dart => package:package-name/second.dart "

+      "main.dart => first.dart => package:packagename/second.dart "

       "=> dart:mirrors",

 };

 

@@ -306,16 +306,16 @@
 main() {}

 ''',

   '/first.dart': '''

-import 'package:package-name/second.dart';

+import 'package:packagename/second.dart';

 ''',

-  '/pkg/package-name/second.dart': '''

+  '/pkg/packagename/second.dart': '''

 export 'dart:mirrors';

 ''',

 

   'paths':

-      "first.dart => package:package-name => dart:mirrors",

+      "first.dart => package:packagename => dart:mirrors",

   'verbosePaths':

-      "main.dart => first.dart => package:package-name/second.dart "

+      "main.dart => first.dart => package:packagename/second.dart "

       "=> dart:mirrors",

 };

 

@@ -326,16 +326,16 @@
 main() {}

 ''',

   '/first.dart': '''

-export 'package:package-name/second.dart';

+export 'package:packagename/second.dart';

 ''',

-  '/pkg/package-name/second.dart': '''

+  '/pkg/packagename/second.dart': '''

 import 'dart:mirrors';

 ''',

 

   'paths':

-      "first.dart => package:package-name => dart:mirrors",

+      "first.dart => package:packagename => dart:mirrors",

   'verbosePaths':

-      "main.dart => first.dart => package:package-name/second.dart "

+      "main.dart => first.dart => package:packagename/second.dart "

       "=> dart:mirrors",

 };

 

diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
index 482bb7c..b9de4fe 100644
--- a/tests/compiler/dart2js/memory_compiler.dart
+++ b/tests/compiler/dart2js/memory_compiler.dart
@@ -110,7 +110,7 @@
     expando[readStringFromUri] = provider;
   } else {
     // When using a cached compiler, it has read a number of files from disk
-    // already (and will not attemp to read them again due to caching). These
+    // already (and will not attempt to read them again due to caching). These
     // files must be available to the new diagnostic handler.
     provider = expando[cachedCompiler.provider];
     readStringFromUri = cachedCompiler.provider;
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 3f62300..f3868b7 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -87,6 +87,8 @@
 medium_integer_test: RuntimeError, OK # Test fails with JS number semantics: issue 1533.
 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
+package/package_test: Fail, OK # dart2js does not support 'package:foo.dart' imports
+package/package1_test: Fail, OK # dart2js does not support 'package:foo.dart' imports
 debugger/*: Skip # Do not run standalone vm debugger tests with dart2js.
 full_coverage_test: Skip
 left_shift_bit_and_op_test: Skip # Integers exceed dart2js precision.
diff --git a/tools/VERSION b/tools/VERSION
index e079632..983e8a9 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
 MINOR 11
 PATCH 0
 PRERELEASE 5
-PRERELEASE_PATCH 1
+PRERELEASE_PATCH 2
diff --git a/tools/deps/dartium.deps/DEPS b/tools/deps/dartium.deps/DEPS
index b88d2f1..f618ff8 100644
--- a/tools/deps/dartium.deps/DEPS
+++ b/tools/deps/dartium.deps/DEPS
@@ -17,6 +17,7 @@
 
   "args_tag": "@0.13.0",
   "barback_rev" : "@29ee90dbcf77cfd64632fa2797a4c8a4f29a4b51",
+  "charcode_tag": "@1.1.0",
   "collection_rev": "@1da9a07f32efa2ba0c391b289e2037391e31da0e",
   "crypto_rev" : "@2df57a1e26dd88e8d0614207d4b062c73209917d",
   "glob_rev": "@704cf75e4f26b417505c5c611bdaacd8808467dd",
@@ -31,6 +32,7 @@
   "metatest_rev": "@e5aa8e4e19fc4188ac2f6d38368a47d8f07c3df1",
   "oauth2_rev": "@1bff41f4d54505c36f2d1a001b83b8b745c452f5",
   "observatory_pub_packages_rev": "@45565",
+  "package_config_tag": "@0.0.3+1",
   "path_rev": "@b657c0854d1cf41c014986fa9d2321f1173df805",
   "plugin_tag": "@0.1.0",
   "pool_rev": "@22e12aeb16ad0b626900dbe79e4a25391ddfb28c",
@@ -125,6 +127,8 @@
 
   "src/dart/third_party/pkg/args":
       "https://github.com/dart-lang/args.git" + Var("args_tag"),
+  "src/dart/third_party/pkg/charcode":
+      "https://github.com/dart-lang/charcode.git" + Var("charcode_tag"),
   "src/dart/third_party/pkg/http_parser":
       "https://github.com/dart-lang/http_parser.git" + Var("http_parser_rev"),
   "src/dart/third_party/pkg/matcher":
@@ -133,6 +137,9 @@
       "https://github.com/dart-lang/metatest.git" + Var("metatest_rev"),
   "src/dart/third_party/pkg/path":
       "https://github.com/dart-lang/path.git" + Var("path_rev"),
+  "src/dart/third_party/pkg/package_config":
+      "https://github.com/dart-lang/package_config.git" +
+      Var("package_config_tag"),
   "src/dart/third_party/pkg/source_span":
       "https://github.com/dart-lang/source_span.git" + Var("source_span_rev"),
   "src/dart/third_party/pkg/stack_trace":