| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 test_limited_ast_to_binary() async { | 323 test_limited_ast_to_binary() async { |
| 324 writeFile('/test/.packages', 'test:lib/'); | 324 writeFile('/test/.packages', 'test:lib/'); |
| 325 String aPath = '/test/lib/a.dart'; | 325 String aPath = '/test/lib/a.dart'; |
| 326 String bPath = '/test/lib/b.dart'; | 326 String bPath = '/test/lib/b.dart'; |
| 327 writeFile( | 327 writeFile( |
| 328 aPath, | 328 aPath, |
| 329 r''' | 329 r''' |
| 330 int topField = 0; | 330 int topField = 0; |
| 331 int get topGetter => 0; | 331 int get topGetter => 0; |
| 332 int topFunction({p}) => 0; | 332 int topFunction({p}) => 0; |
| 333 |
| 334 abstract class I { |
| 335 int interfaceField; |
| 336 int get interfaceGetter; |
| 337 int interfaceMethod(); |
| 338 } |
| 333 | 339 |
| 334 class A { | 340 class A implements I { |
| 335 static int staticField; | 341 static int staticField; |
| 336 static int get staticGetter => 0; | 342 static int get staticGetter => 0; |
| 337 static int staticMethod() => 0; | 343 static int staticMethod() => 0; |
| 338 | 344 |
| 339 int instanceField; | 345 int instanceField; |
| 340 int get instanceGetter => 0; | 346 int get instanceGetter => 0; |
| 341 int instanceMethod() => 0; | 347 int instanceMethod() => 0; |
| 348 |
| 349 int interfaceField; |
| 350 int get interfaceGetter => 0; |
| 351 int interfaceMethod() => 0; |
| 342 | 352 |
| 343 A(); | 353 A(); |
| 344 A.named(); | 354 A.named(); |
| 345 } | 355 } |
| 346 '''); | 356 '''); |
| 347 Uri bUri = writeFile( | 357 Uri bUri = writeFile( |
| 348 bPath, | 358 bPath, |
| 349 r''' | 359 r''' |
| 350 import 'a.dart'; | 360 import 'a.dart'; |
| 351 | 361 |
| 352 class B extends A { | 362 class B extends A { |
| 353 B() : super(); | 363 B() : super(); |
| 354 B.named() : super.named(); | 364 B.named() : super.named(); |
| 355 | 365 |
| 356 void foo() { | 366 void foo() { |
| 357 super.instanceMethod(); | 367 super.instanceMethod(); |
| 358 instanceMethod(); | 368 instanceMethod(); |
| 369 |
| 370 super.interfaceField; |
| 371 super.interfaceField = 0; |
| 372 super.interfaceGetter; |
| 373 super.interfaceMethod(); |
| 359 } | 374 } |
| 360 | 375 |
| 361 int instanceMethod() => 0; | 376 int instanceMethod() => 0; |
| 377 |
| 378 int interfaceField; |
| 379 int get interfaceGetter => 0; |
| 380 int interfaceMethod() => 0; |
| 362 } | 381 } |
| 363 | 382 |
| 364 main() { | 383 main() { |
| 365 topField; | 384 topField; |
| 366 topField = 0; | 385 topField = 0; |
| 367 var v1 = topGetter; | 386 var v1 = topGetter; |
| 368 var v2 = topFunction(p: 0); | 387 var v2 = topFunction(p: 0); |
| 369 | 388 |
| 370 A.staticField; | 389 A.staticField; |
| 371 A.staticField = 0; | 390 A.staticField = 0; |
| 372 var v3 = A.staticGetter; | 391 var v3 = A.staticGetter; |
| 373 var v4 = A.staticMethod(); | 392 var v4 = A.staticMethod(); |
| 374 | 393 |
| 375 var a = new A(); | 394 var a = new A(); |
| 395 |
| 376 a.instanceField; | 396 a.instanceField; |
| 377 a.instanceField = 0; | 397 a.instanceField = 0; |
| 378 var v5 = a.instanceGetter; | 398 var v5 = a.instanceGetter; |
| 379 var v6 = a.instanceMethod(); | 399 var v6 = a.instanceMethod(); |
| 400 |
| 401 a.interfaceField; |
| 402 a.interfaceField = 0; |
| 403 var v7 = a.interfaceGetter; |
| 404 var v8 = a.interfaceMethod(); |
| 380 } | 405 } |
| 381 '''); | 406 '''); |
| 382 | 407 |
| 383 Program program = await getInitialState(bUri); | 408 Program program = await getInitialState(bUri); |
| 384 | 409 |
| 385 String initialKernelText; | 410 String initialKernelText; |
| 386 List<int> bytes; | 411 List<int> bytes; |
| 387 { | 412 { |
| 388 Library initialLibrary = _getLibrary(program, bUri); | 413 Library initialLibrary = _getLibrary(program, bUri); |
| 389 initialKernelText = _getLibraryText(initialLibrary); | 414 initialKernelText = _getLibraryText(initialLibrary); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 throw fail('No library found with URI "$uri"'); | 683 throw fail('No library found with URI "$uri"'); |
| 659 } | 684 } |
| 660 | 685 |
| 661 String _getLibraryText(Library library) { | 686 String _getLibraryText(Library library) { |
| 662 StringBuffer buffer = new StringBuffer(); | 687 StringBuffer buffer = new StringBuffer(); |
| 663 new Printer(buffer, syntheticNames: new NameSystem()) | 688 new Printer(buffer, syntheticNames: new NameSystem()) |
| 664 .writeLibraryFile(library); | 689 .writeLibraryFile(library); |
| 665 return buffer.toString(); | 690 return buffer.toString(); |
| 666 } | 691 } |
| 667 } | 692 } |
| OLD | NEW |