| 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 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 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'package:compiler/src/elements/elements.dart' show ClassElement; | 8 import 'package:compiler/src/elements/elements.dart' show ClassElement; |
| 9 import 'package:compiler/src/elements/names.dart'; | 9 import 'package:compiler/src/elements/names.dart'; |
| 10 import 'package:compiler/src/universe/call_structure.dart'; | 10 import 'package:compiler/src/universe/call_structure.dart'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 Future run(List<String> instantiated) async { | 39 Future run(List<String> instantiated) async { |
| 40 StringBuffer main = new StringBuffer(); | 40 StringBuffer main = new StringBuffer(); |
| 41 main.write('main() {'); | 41 main.write('main() {'); |
| 42 for (String cls in instantiated) { | 42 for (String cls in instantiated) { |
| 43 main.write('new $cls();'); | 43 main.write('new $cls();'); |
| 44 } | 44 } |
| 45 main.write('}'); | 45 main.write('}'); |
| 46 testMode = '$instantiated'; | 46 testMode = '$instantiated'; |
| 47 | 47 |
| 48 var env = await TypeEnvironment.create(CLASSES, | 48 var env = await TypeEnvironment.create(CLASSES, |
| 49 mainSource: main.toString(), useMockCompiler: false); | 49 mainSource: main.toString(), compileMode: CompileMode.memory); |
| 50 foo = new Selector.call(const PublicName('foo'), CallStructure.NO_ARGS); | 50 foo = new Selector.call(const PublicName('foo'), CallStructure.NO_ARGS); |
| 51 bar = new Selector.call(const PublicName('bar'), CallStructure.NO_ARGS); | 51 bar = new Selector.call(const PublicName('bar'), CallStructure.NO_ARGS); |
| 52 baz = new Selector.call(const PublicName('baz'), CallStructure.NO_ARGS); | 52 baz = new Selector.call(const PublicName('baz'), CallStructure.NO_ARGS); |
| 53 | 53 |
| 54 closedWorld = env.closedWorld; | 54 closedWorld = env.closedWorld; |
| 55 superclass = env.getElement('Superclass'); | 55 superclass = env.getElement('Superclass'); |
| 56 subclass = env.getElement('Subclass'); | 56 subclass = env.getElement('Subclass'); |
| 57 subtype = env.getElement('Subtype'); | 57 subtype = env.getElement('Subtype'); |
| 58 } | 58 } |
| 59 | 59 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 check(subtype, ClassQuery.EXACT, foo, true); | 280 check(subtype, ClassQuery.EXACT, foo, true); |
| 281 check(subtype, ClassQuery.EXACT, bar, false); | 281 check(subtype, ClassQuery.EXACT, bar, false); |
| 282 check(subtype, ClassQuery.EXACT, baz, true); | 282 check(subtype, ClassQuery.EXACT, baz, true); |
| 283 check(subtype, ClassQuery.SUBCLASS, foo, true); | 283 check(subtype, ClassQuery.SUBCLASS, foo, true); |
| 284 check(subtype, ClassQuery.SUBCLASS, bar, false); | 284 check(subtype, ClassQuery.SUBCLASS, bar, false); |
| 285 check(subtype, ClassQuery.SUBCLASS, baz, true); | 285 check(subtype, ClassQuery.SUBCLASS, baz, true); |
| 286 check(subtype, ClassQuery.SUBTYPE, foo, true); | 286 check(subtype, ClassQuery.SUBTYPE, foo, true); |
| 287 check(subtype, ClassQuery.SUBTYPE, bar, false); | 287 check(subtype, ClassQuery.SUBTYPE, bar, false); |
| 288 check(subtype, ClassQuery.SUBTYPE, baz, true); | 288 check(subtype, ClassQuery.SUBTYPE, baz, true); |
| 289 } | 289 } |
| OLD | NEW |