OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 import 'compiler_helper.dart'; | 7 import 'compiler_helper.dart'; |
8 import 'package:compiler/src/resolution/class_members.dart' | 8 import 'package:compiler/src/resolution/class_members.dart' |
9 show MembersCreator; | 9 show MembersCreator; |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 testNoSuchMethod(), | 23 testNoSuchMethod(), |
24 ])); | 24 ])); |
25 } | 25 } |
26 | 26 |
27 Future check(String source, {errors, warnings, hints, infos}) { | 27 Future check(String source, {errors, warnings, hints, infos}) { |
28 return MockCompiler.create((MockCompiler compiler) { | 28 return MockCompiler.create((MockCompiler compiler) { |
29 compiler.diagnosticHandler = createHandler(compiler, source); | 29 compiler.diagnosticHandler = createHandler(compiler, source); |
30 compiler.parseScript(source); | 30 compiler.parseScript(source); |
31 var cls = compiler.mainApp.find('Class'); | 31 var cls = compiler.mainApp.find('Class'); |
32 cls.ensureResolved(compiler.resolution); | 32 cls.ensureResolved(compiler.resolution); |
33 MembersCreator.computeAllClassMembers(compiler, cls); | 33 MembersCreator.computeAllClassMembers(compiler.resolution, cls); |
34 | 34 |
35 toList(o) => o == null ? [] : o is List ? o : [o]; | 35 toList(o) => o == null ? [] : o is List ? o : [o]; |
36 | 36 |
37 compareMessageKinds( | 37 compareMessageKinds( |
38 source, toList(errors), | 38 source, toList(errors), |
39 compiler.diagnosticCollector.errors, 'error'); | 39 compiler.diagnosticCollector.errors, 'error'); |
40 | 40 |
41 compareMessageKinds( | 41 compareMessageKinds( |
42 source, toList(warnings), | 42 source, toList(warnings), |
43 compiler.diagnosticCollector.warnings, 'warning'); | 43 compiler.diagnosticCollector.warnings, 'warning'); |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 check(""" | 1544 check(""" |
1545 class A { | 1545 class A { |
1546 noSuchMethod(_) => null; | 1546 noSuchMethod(_) => null; |
1547 method(); // testNoSuchMethod:13 | 1547 method(); // testNoSuchMethod:13 |
1548 } | 1548 } |
1549 class Class extends A { | 1549 class Class extends A { |
1550 } | 1550 } |
1551 """), | 1551 """), |
1552 ]); | 1552 ]); |
1553 } | 1553 } |
OLD | NEW |