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

Unified Diff: dart/tests/compiler/dart2js/metadata_test.dart

Issue 10879006: Create an outline of metadata API in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/tests/compiler/dart2js/metadata_test.dart
diff --git a/dart/tests/compiler/dart2js/metadata_test.dart b/dart/tests/compiler/dart2js/metadata_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..195541bde8efb6b58e5ff100be43fde37bacfb18
--- /dev/null
+++ b/dart/tests/compiler/dart2js/metadata_test.dart
@@ -0,0 +1,32 @@
+// 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:uri");
+
+#import('compiler_helper.dart');
+
+#import('../../../lib/compiler/implementation/elements/elements.dart');
+#import('../../../lib/compiler/implementation/leg.dart');
+
+void testClassMetadata() {
+ // TODO(ahe): native should be "const", not "final".
+ final source = """final native = 'xyz';
+ @native class Foo {}
+ main() {}""";
+
+ check(compiler, element) {
+ return; // TODO(ahe): I'm working on the following.
+ Expect.isFalse(element.metadata.isEmpty());
+ MetadataAnnotation annotation = element.metadata.head;
+ Expect.isNotNull(annotation);
+ Constant value = annotation.value;
+ print(value);
+ }
+
+ compileAndCheck(source, 'Foo', check);
+}
+
+void main() {
+ testClassMetadata();
+}
« no previous file with comments | « dart/tests/compiler/dart2js/compiler_helper.dart ('k') | dart/tests/compiler/dart2js/return_type_inferer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698