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

Side by Side Diff: tests/lib_strong/mirrors/field_metadata2_test.dart

Issue 2861503002: fix #29530, field metadata generation (Closed)
Patch Set: wip Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // compile options: --emit-metadata
2 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file.
5
6 // Run essentially the same test, but with emit-metadata compile option,
7 // which allows us to reflect on the fields.
8 import 'dart:mirrors';
9 import 'package:expect/expect.dart';
10
11 import 'field_metadata_test.dart' as field_metadata_test;
12 import 'field_metadata_test.dart' show Foo, Bar;
13
14 void main() {
15 // Make sure the other test still works.
16 field_metadata_test.main();
17
18 // Check that we can now reflect on the annotations.
19 dynamic f = new Foo();
20 var members = reflect(f).type.declarations;
21 var bar = members[#x].metadata.first.reflectee as Bar;
22 Expect.equals(bar.name, 'bar');
23
24 var baz = members[#y].metadata.first.reflectee as Bar;
25 Expect.equals(baz.name, 'baz');
26 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart ('k') | tests/lib_strong/mirrors/field_metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698