| 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();
|
| }
|
|
|