| 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 @TestOn('vm') | 5 @TestOn('vm') |
| 6 library smoke.test.codegen.recorder_test; | 6 library smoke.test.codegen.recorder_test; |
| 7 | 7 |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:smoke/codegen/generator.dart'; | 9 import 'package:smoke/codegen/generator.dart'; |
| 10 import 'package:smoke/codegen/recorder.dart'; | 10 import 'package:smoke/codegen/recorder.dart'; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 recorder.lookupParent(lib.getType('A')); | 82 recorder.lookupParent(lib.getType('A')); |
| 83 recorder.lookupParent(lib.getType('B')); | 83 recorder.lookupParent(lib.getType('B')); |
| 84 recorder.lookupParent(lib.getType('C')); | 84 recorder.lookupParent(lib.getType('C')); |
| 85 recorder.lookupParent(lib.getType('D')); | 85 recorder.lookupParent(lib.getType('D')); |
| 86 recorder.lookupParent(lib.getType('E')); | 86 recorder.lookupParent(lib.getType('E')); |
| 87 recorder.lookupParent(lib.getType('E2')); | 87 recorder.lookupParent(lib.getType('E2')); |
| 88 recorder.lookupParent(lib.getType('F')); | 88 recorder.lookupParent(lib.getType('F')); |
| 89 recorder.lookupParent(lib.getType('F2')); | 89 recorder.lookupParent(lib.getType('F2')); |
| 90 recorder.lookupParent(lib.getType('G')); | 90 recorder.lookupParent(lib.getType('G')); |
| 91 recorder.lookupParent(lib.getType('H')); | 91 recorder.lookupParent(lib.getType('H')); |
| 92 var coreLib = | 92 var coreLib = lib.context.typeProvider.objectType.element.library; |
| 93 lib.visibleLibraries.firstWhere((l) => l.displayName == 'dart.core'); | |
| 94 recorder.lookupParent(coreLib.getType('int')); | 93 recorder.lookupParent(coreLib.getType('int')); |
| 95 recorder.lookupParent(coreLib.getType('num')); | 94 recorder.lookupParent(coreLib.getType('num')); |
| 96 | 95 |
| 97 checkResults(generator, | 96 checkResults(generator, |
| 98 imports: ["import '/common.dart' as smoke_0;",], | 97 imports: ["import '/common.dart' as smoke_0;",], |
| 99 topLevel: 'abstract class _M0 {} // C & A\n', | 98 topLevel: 'abstract class _M0 {} // C & A\n', |
| 100 initCall: 'useGeneratedCode(new StaticConfiguration(\n' | 99 initCall: 'useGeneratedCode(new StaticConfiguration(\n' |
| 101 ' checkedMode: false,\n' | 100 ' checkedMode: false,\n' |
| 102 ' parents: {\n' | 101 ' parents: {\n' |
| 103 ' smoke_0.AnnotB: smoke_0.Annot,\n' | 102 ' smoke_0.AnnotB: smoke_0.Annot,\n' |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 | 771 |
| 773 class K { | 772 class K { |
| 774 @AnnotC(named: true) int k; | 773 @AnnotC(named: true) int k; |
| 775 @AnnotC() int k2; | 774 @AnnotC() int k2; |
| 776 } | 775 } |
| 777 ''' | 776 ''' |
| 778 }; | 777 }; |
| 779 | 778 |
| 780 String resolveImportUrl(LibraryElement lib) => | 779 String resolveImportUrl(LibraryElement lib) => |
| 781 lib.isDartCore ? 'dart:core' : '/${lib.displayName}.dart'; | 780 lib.isDartCore ? 'dart:core' : '/${lib.displayName}.dart'; |
| OLD | NEW |