Version 0.8.3.2 .

svn merge -c 28882,28883,28887 https://dart.googlecode.com/svn/branches/bleeding_edge trunk

git-svn-id: http://dart.googlecode.com/svn/trunk@28898 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index 66a039d..6098512 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -1060,6 +1060,7 @@
     // Elements required by enqueueHelpers are global dependencies
     // that are not pulled in by a particular element.
     backend.enqueueHelpers(enqueuer.resolution, globalDependencies);
+    resolveLibraryMetadata();
     processQueue(enqueuer.resolution, main);
     enqueuer.resolution.logSummary(log);
 
@@ -1127,6 +1128,19 @@
     }
   }
 
+  // Resolves metadata on library elements.  This is necessary in order to
+  // resolve metadata classes referenced only from metadata on library tags.
+  // TODO(ahe): Figure out how to do this lazily.
+  void resolveLibraryMetadata() {
+    for (LibraryElement library in libraries.values) {
+      if (library.metadata != null) {
+        for (MetadataAnnotation metadata in library.metadata) {
+          metadata.ensureResolved(this);
+        }
+      }
+    }
+  }
+
   void processQueue(Enqueuer world, Element main) {
     world.nativeEnqueuer.processNativeClasses(libraries.values);
     if (main != null) {
diff --git a/tests/lib/mirrors/library_metatarget_test.dart b/tests/lib/mirrors/library_metatarget_test.dart
new file mode 100644
index 0000000..8bbb64f
--- /dev/null
+++ b/tests/lib/mirrors/library_metatarget_test.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for the combined use of metatargets and library tags.
+
+library topLib;
+
+import 'library_metatarget_test_lib.dart';
+import 'library_metatarget_test_annotations_lib.dart';
+
+@MirrorsUsed(metaTargets:const [Reflectable])
+import 'dart:mirrors';
+
+void main() {
+  print(new A());
+}
diff --git a/tests/lib/mirrors/library_metatarget_test_annotations_lib.dart b/tests/lib/mirrors/library_metatarget_test_annotations_lib.dart
new file mode 100644
index 0000000..20fcfcf
--- /dev/null
+++ b/tests/lib/mirrors/library_metatarget_test_annotations_lib.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for the combined use of metatargets and library tags.
+
+library annotations;
+
+class UsedOnlyOnLibrary {
+  const UsedOnlyOnLibrary();
+}
+const usedOnlyOnLibrary = const UsedOnlyOnLibrary();
+
+class Reflectable {
+  const Reflectable();
+}
+const Reflectable reflectable = const Reflectable();
diff --git a/tests/lib/mirrors/library_metatarget_test_lib.dart b/tests/lib/mirrors/library_metatarget_test_lib.dart
new file mode 100644
index 0000000..3732f92
--- /dev/null
+++ b/tests/lib/mirrors/library_metatarget_test_lib.dart
@@ -0,0 +1,15 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for the combined use of metatargets and library tags.
+
+@usedOnlyOnLibrary
+library subLib;
+
+import 'library_metatarget_test_annotations_lib.dart';
+
+class A {
+  @reflectable var reflectableField = 1;
+  var nonreflectableField = 2;
+}
diff --git a/tools/VERSION b/tools/VERSION
index 46461a5..b409bea 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
 MAJOR 0
 MINOR 8
 BUILD 3
-PATCH 1 
+PATCH 2