Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: tests/compiler/dart2js/reexport_handled_test.dart

Issue 11747010: Process handled exports correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Unittest added. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/language/reexport_core_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library reexport_handled_test;
6
7 import 'dart:uri';
8 import 'mock_compiler.dart';
9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart';
ahe 2013/01/16 17:52:59 Could you "show" what is imported here?
ahe 2013/01/16 17:52:59 Also, add this: import '../../../sdk/lib/_interna
Johnni Winther 2013/01/17 14:23:09 Nothing apparantly. Removed.
Johnni Winther 2013/01/17 14:23:09 Done.
10
11 var exportingLibraryUri = new Uri('exporting.dart');
ahe 2013/01/16 17:52:59 var -> final.
12 var exportingLibrarySource = '''
ahe 2013/01/16 17:52:59 For consistency with other tests, use: const Stri
13 library exporting;
14 var foo;
15 ''';
16
17 var reexportingLibraryUri = new Uri('reexporting.dart');
ahe 2013/01/16 17:52:59 var -> final.
Johnni Winther 2013/01/17 14:23:09 Done.
18 var reexportingLibrarySource = '''
ahe 2013/01/16 17:52:59 const HACKER_STYLE
Johnni Winther 2013/01/17 14:23:09 Done.
19 library reexporting;
20 export 'exporting.dart';
21 ''';
22
23 void main() {
24 var compiler = new MockCompiler();
25 compiler.registerSource(exportingLibraryUri, exportingLibrarySource);
26 compiler.registerSource(reexportingLibraryUri, reexportingLibrarySource);
27
28 // Load exporting library before the reexporting library.
29 var exportingLibrary = compiler.libraryLoader.loadLibrary(
30 exportingLibraryUri, null, exportingLibraryUri);
31 Expect.isTrue(exportingLibrary.exportsHandled);
32 var foo = findInExports(exportingLibrary, 'foo');
33 Expect.isNotNull(foo);
34 Expect.isTrue(foo.isField());
35
36 // Load reexporting library when exports are handled on the exporting library.
37 var reexportingLibrary = compiler.libraryLoader.loadLibrary(
38 reexportingLibraryUri, null, reexportingLibraryUri);
39 foo = findInExports(reexportingLibrary, 'foo');
40 Expect.isNotNull(foo);
41 Expect.isTrue(foo.isField());
42 }
43
44 Element findInExports(LibraryElement library, String name) {
45 for (var export in library.exports) {
46 if (export.name.slowToString() == name) {
47 return export;
48 }
49 }
50 return null;
51 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/language/reexport_core_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698