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