OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 reexport_handled_test; | 5 library reexport_handled_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 'mock_compiler.dart'; | 9 import 'mock_compiler.dart'; |
10 import 'package:compiler/src/elements/elements.dart' | |
11 show Element, LibraryElement; | |
12 | 10 |
13 final exportingLibraryUri = Uri.parse('exporting.dart'); | 11 final exportingLibraryUri = Uri.parse('exporting.dart'); |
14 const String EXPORTING_LIBRARY_SOURCE = ''' | 12 const String EXPORTING_LIBRARY_SOURCE = ''' |
15 library exporting; | 13 library exporting; |
16 var foo; | 14 var foo; |
17 '''; | 15 '''; |
18 | 16 |
19 final reexportingLibraryUri = Uri.parse('reexporting.dart'); | 17 final reexportingLibraryUri = Uri.parse('reexporting.dart'); |
20 const String REEXPORTING_LIBRARY_SOURCE = ''' | 18 const String REEXPORTING_LIBRARY_SOURCE = ''' |
21 library reexporting; | 19 library reexporting; |
(...skipping 11 matching lines...) Expand all Loading... |
33 }).then((loadedLibraries) { | 31 }).then((loadedLibraries) { |
34 compiler.processLoadedLibraries(loadedLibraries); | 32 compiler.processLoadedLibraries(loadedLibraries); |
35 var exportingLibrary = loadedLibraries.rootLibrary; | 33 var exportingLibrary = loadedLibraries.rootLibrary; |
36 Expect.isTrue(exportingLibrary.exportsHandled); | 34 Expect.isTrue(exportingLibrary.exportsHandled); |
37 var foo = exportingLibrary.findExported('foo'); | 35 var foo = exportingLibrary.findExported('foo'); |
38 Expect.isNotNull(foo); | 36 Expect.isNotNull(foo); |
39 Expect.isTrue(foo.isField); | 37 Expect.isTrue(foo.isField); |
40 | 38 |
41 // Load reexporting library when exports are handled on the exporting li
brary. | 39 // Load reexporting library when exports are handled on the exporting li
brary. |
42 return compiler.libraryLoader.loadLibrary(reexportingLibraryUri); | 40 return compiler.libraryLoader.loadLibrary(reexportingLibraryUri); |
43 }).then((loadedLibraries) { | 41 }).then((dynamic loadedLibraries) { |
44 compiler.processLoadedLibraries(loadedLibraries); | 42 compiler.processLoadedLibraries(loadedLibraries); |
45 var foo = loadedLibraries.rootLibrary.findExported('foo'); | 43 var foo = loadedLibraries.rootLibrary.findExported('foo'); |
46 Expect.isNotNull(foo); | 44 Expect.isNotNull(foo); |
47 Expect.isTrue(foo.isField); | 45 Expect.isTrue(foo.isField); |
48 })); | 46 })); |
49 } | 47 } |
OLD | NEW |