| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library jsinterop.abstract_test; | 5 library jsinterop.abstract_test; |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:compiler/src/common.dart'; | 9 import 'package:compiler/src/common.dart'; |
| 10 import '../memory_compiler.dart'; | 10 import '../memory_compiler.dart'; |
| 11 | 11 |
| 12 void main() { | 12 void main() { |
| 13 asyncTest(() async { | 13 asyncTest(() async { |
| 14 DiagnosticCollector collector = new DiagnosticCollector(); | 14 DiagnosticCollector collector = new DiagnosticCollector(); |
| 15 await runCompiler( | 15 await runCompiler(diagnosticHandler: collector, memorySourceFiles: const { |
| 16 diagnosticHandler: collector, | 16 'main.dart': ''' |
| 17 memorySourceFiles: const {'main.dart': ''' | |
| 18 import 'package:js/js.dart'; | 17 import 'package:js/js.dart'; |
| 19 | 18 |
| 20 @JS() | 19 @JS() |
| 21 class A { | 20 class A { |
| 22 get foo; | 21 get foo; |
| 23 } | 22 } |
| 24 | 23 |
| 25 main() => new A(); | 24 main() => new A(); |
| 26 '''}); | 25 ''' |
| 27 Expect.equals(0, collector.errors.length, | 26 }); |
| 28 'Unexpected error count.'); | 27 Expect.equals(0, collector.errors.length, 'Unexpected error count.'); |
| 29 Expect.equals(1, collector.warnings.length, | 28 Expect.equals(1, collector.warnings.length, 'Unexpected warning count.'); |
| 30 'Unexpected warning count.'); | |
| 31 Expect.equals(MessageKind.ABSTRACT_GETTER, | 29 Expect.equals(MessageKind.ABSTRACT_GETTER, |
| 32 collector.warnings.first.messageKind, | 30 collector.warnings.first.messageKind, 'Unexpected warning.'); |
| 33 'Unexpected warning.'); | |
| 34 }); | 31 }); |
| 35 } | 32 } |
| OLD | NEW |