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

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

Issue 10869013: Reify partial metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comment 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
« no previous file with comments | « dart/lib/compiler/implementation/scanner/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index 195541bde8efb6b58e5ff100be43fde37bacfb18..ca99d8ae198ea3eaea6b5025ade58971cb1f6740 100644
--- a/dart/tests/compiler/dart2js/metadata_test.dart
+++ b/dart/tests/compiler/dart2js/metadata_test.dart
@@ -16,17 +16,36 @@ void testClassMetadata() {
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);
+ return; // TODO(ahe): I'm working on the following.
+ Expect.isNotNull(value);
}
compileAndCheck(source, 'Foo', check);
}
+void testTopLevelMethodMetadata() {
+ // TODO(ahe): native should be "const", not "final".
+ final source = """final native = 'xyz';
+ @native
+ main() {}""";
+
+ check(compiler, element) {
+ Expect.isFalse(element.metadata.isEmpty());
+ MetadataAnnotation annotation = element.metadata.head;
+ Expect.isNotNull(annotation);
+ Constant value = annotation.value;
+ return; // TODO(ahe): I'm working on the following.
+ Expect.isNotNull(value);
+ }
+
+ compileAndCheck(source, 'main', check);
+}
+
void main() {
testClassMetadata();
+ testTopLevelMethodMetadata();
}
« no previous file with comments | « dart/lib/compiler/implementation/scanner/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698