OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 | 6 |
7 import 'package:front_end/compiler_options.dart'; | 7 import 'package:front_end/compiler_options.dart'; |
8 import 'package:front_end/incremental_kernel_generator.dart'; | 8 import 'package:front_end/incremental_kernel_generator.dart'; |
9 import 'package:front_end/memory_file_system.dart'; | 9 import 'package:front_end/memory_file_system.dart'; |
10 import 'package:front_end/src/incremental/byte_store.dart'; | 10 import 'package:front_end/src/incremental/byte_store.dart'; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 import "./b.dart" as b; | 201 import "./b.dart" as b; |
202 import "dart:core" as core; | 202 import "dart:core" as core; |
203 | 203 |
204 static field a::A a; | 204 static field a::A a; |
205 static field b::B b; | 205 static field b::B b; |
206 static field core::int c; | 206 static field core::int c; |
207 '''); | 207 '''); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
| 211 test_compile_export_hideWithLocal() async { |
| 212 writeFile('/test/.packages', 'test:lib/'); |
| 213 String aPath = '/test/lib/a.dart'; |
| 214 String bPath = '/test/lib/b.dart'; |
| 215 String cPath = '/test/lib/c.dart'; |
| 216 writeFile(aPath, 'class A {} class B {}'); |
| 217 writeFile(bPath, 'export "a.dart"; class B {}'); |
| 218 Uri cUri = writeFile( |
| 219 cPath, |
| 220 r''' |
| 221 import 'b.dart'; |
| 222 A a; |
| 223 B b; |
| 224 '''); |
| 225 |
| 226 Program program = await getInitialState(cUri); |
| 227 Library library = _getLibrary(program, cUri); |
| 228 expect( |
| 229 _getLibraryText(library), |
| 230 r''' |
| 231 library; |
| 232 import self as self; |
| 233 import "./a.dart" as a; |
| 234 import "./b.dart" as b; |
| 235 |
| 236 static field a::A a; |
| 237 static field b::B b; |
| 238 '''); |
| 239 } |
| 240 |
211 test_compile_typedef() async { | 241 test_compile_typedef() async { |
212 writeFile('/test/.packages', 'test:lib/'); | 242 writeFile('/test/.packages', 'test:lib/'); |
213 String aPath = '/test/lib/a.dart'; | 243 String aPath = '/test/lib/a.dart'; |
214 String bPath = '/test/lib/b.dart'; | 244 String bPath = '/test/lib/b.dart'; |
215 writeFile(aPath, 'typedef int F<T>(T x);'); | 245 writeFile(aPath, 'typedef int F<T>(T x);'); |
216 Uri bUri = writeFile( | 246 Uri bUri = writeFile( |
217 bPath, | 247 bPath, |
218 r''' | 248 r''' |
219 import 'a.dart'; | 249 import 'a.dart'; |
220 F<String> f; | 250 F<String> f; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 throw fail('No library found with URI "$uri"'); | 454 throw fail('No library found with URI "$uri"'); |
425 } | 455 } |
426 | 456 |
427 String _getLibraryText(Library library) { | 457 String _getLibraryText(Library library) { |
428 StringBuffer buffer = new StringBuffer(); | 458 StringBuffer buffer = new StringBuffer(); |
429 new Printer(buffer, syntheticNames: new NameSystem()) | 459 new Printer(buffer, syntheticNames: new NameSystem()) |
430 .writeLibraryFile(library); | 460 .writeLibraryFile(library); |
431 return buffer.toString(); | 461 return buffer.toString(); |
432 } | 462 } |
433 } | 463 } |
OLD | NEW |