OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 @JS() | 5 @JS() |
6 library js_typed_interop_anonymous_test; | 6 library js_typed_interop_anonymous_test; |
7 | 7 |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'dart:js' as js; | 9 import 'dart:js' as js; |
10 | 10 |
11 import 'package:js/js.dart'; | 11 import 'package:js/js.dart'; |
12 import 'package:minitest/minitest.dart'; | 12 import 'package:expect/minitest.dart'; |
13 | 13 |
14 @JS() @anonymous | 14 @JS() @anonymous |
15 class Literal { | 15 class Literal { |
16 external factory Literal({int x, String y, num z}); | 16 external factory Literal({int x, String y, num z}); |
17 | 17 |
18 external int get x; | 18 external int get x; |
19 external String get y; | 19 external String get y; |
20 external num get z; | 20 external num get z; |
21 } | 21 } |
22 | 22 |
23 main() { | 23 main() { |
24 test('simple', () { | 24 test('simple', () { |
25 var l = new Literal(x: 3, y: "foo"); | 25 var l = new Literal(x: 3, y: "foo"); |
26 expect(l.x, equals(3)); | 26 expect(l.x, equals(3)); |
27 expect(l.y, equals("foo")); | 27 expect(l.y, equals("foo")); |
28 expect(l.z, isNull); | 28 expect(l.z, isNull); |
29 }); | 29 }); |
30 } | 30 } |
OLD | NEW |