| 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 library trydart.incremental_compilation_update_test; | 5 library trydart.incremental_compilation_update_test; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 | 8 |
| 9 import 'dart:async' show | 9 import 'dart:async' show |
| 10 Future; | 10 Future; |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 print('v1'); | 572 print('v1'); |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 main() { | 575 main() { |
| 576 instance = new A('v2'); | 576 instance = new A('v2'); |
| 577 foo(); | 577 foo(); |
| 578 } | 578 } |
| 579 """, | 579 """, |
| 580 const <String>['v2']), | 580 const <String>['v2']), |
| 581 ], | 581 ], |
| 582 |
| 583 // Test that top-level functions can be added. |
| 584 const <ProgramResult>[ |
| 585 const ProgramResult( |
| 586 r""" |
| 587 main() { |
| 588 try { |
| 589 foo(); |
| 590 } catch(e) { |
| 591 print('v1'); |
| 592 } |
| 593 } |
| 594 """, |
| 595 const <String>['v1']), |
| 596 const ProgramResult( |
| 597 r""" |
| 598 foo() { |
| 599 print('v2'); |
| 600 } |
| 601 |
| 602 main() { |
| 603 try { |
| 604 foo(); |
| 605 } catch(e) { |
| 606 print('v1'); |
| 607 } |
| 608 } |
| 609 """, |
| 610 const <String>['v2']), |
| 611 ], |
| 612 |
| 613 // Test that static methods can be added. |
| 614 const <ProgramResult>[ |
| 615 const ProgramResult( |
| 616 r""" |
| 617 class C { |
| 618 } |
| 619 |
| 620 main() { |
| 621 try { |
| 622 C.foo(); |
| 623 } catch(e) { |
| 624 print('v1'); |
| 625 } |
| 626 } |
| 627 """, |
| 628 const <String>['v1']), |
| 629 const ProgramResult( |
| 630 r""" |
| 631 class C { |
| 632 static foo() { |
| 633 print('v2'); |
| 634 } |
| 635 } |
| 636 |
| 637 main() { |
| 638 try { |
| 639 C.foo(); |
| 640 } catch(e) { |
| 641 print('v1'); |
| 642 } |
| 643 } |
| 644 """, |
| 645 const <String>['v2']), |
| 646 ], |
| 647 |
| 648 // Test that instance methods can be added. |
| 649 const <ProgramResult>[ |
| 650 const ProgramResult( |
| 651 r""" |
| 652 class C { |
| 653 } |
| 654 |
| 655 var instance; |
| 656 |
| 657 main() { |
| 658 if (instance == null) { |
| 659 instance = new C(); |
| 660 } |
| 661 |
| 662 try { |
| 663 instance.foo(); |
| 664 } catch(e) { |
| 665 print('v1'); |
| 666 } |
| 667 } |
| 668 """, |
| 669 const <String>['v1']), |
| 670 const ProgramResult( |
| 671 r""" |
| 672 class C { |
| 673 foo() { |
| 674 print('v2'); |
| 675 } |
| 676 } |
| 677 |
| 678 var instance; |
| 679 |
| 680 main() { |
| 681 if (instance == null) { |
| 682 instance = new C(); |
| 683 } |
| 684 |
| 685 try { |
| 686 instance.foo(); |
| 687 } catch(e) { |
| 688 print('v1'); |
| 689 } |
| 690 } |
| 691 """, |
| 692 const <String>['v2']), |
| 693 ], |
| 694 |
| 695 // Test that top-level functions can have signature changed. |
| 696 const <ProgramResult>[ |
| 697 const ProgramResult( |
| 698 r""" |
| 699 foo() { |
| 700 print('v1'); |
| 701 } |
| 702 |
| 703 main() { |
| 704 foo(); |
| 705 } |
| 706 """, |
| 707 const <String>['v1']), |
| 708 const ProgramResult( |
| 709 r""" |
| 710 void foo() { |
| 711 print('v2'); |
| 712 } |
| 713 |
| 714 main() { |
| 715 foo(); |
| 716 } |
| 717 """, |
| 718 const <String>['v2']), |
| 719 ], |
| 720 |
| 721 // Test that static methods can have signature changed. |
| 722 const <ProgramResult>[ |
| 723 const ProgramResult( |
| 724 r""" |
| 725 class C { |
| 726 static foo() { |
| 727 print('v1'); |
| 728 } |
| 729 } |
| 730 |
| 731 main() { |
| 732 C.foo(); |
| 733 } |
| 734 """, |
| 735 const <String>['v1']), |
| 736 const ProgramResult( |
| 737 r""" |
| 738 class C { |
| 739 static void foo() { |
| 740 print('v2'); |
| 741 } |
| 742 } |
| 743 |
| 744 main() { |
| 745 C.foo(); |
| 746 } |
| 747 """, |
| 748 const <String>['v2']), |
| 749 ], |
| 750 |
| 751 // Test that instance methods can have signature changed. |
| 752 const <ProgramResult>[ |
| 753 const ProgramResult( |
| 754 r""" |
| 755 class C { |
| 756 foo() { |
| 757 print('v1'); |
| 758 } |
| 759 } |
| 760 |
| 761 var instance; |
| 762 |
| 763 main() { |
| 764 if (instance == null) { |
| 765 instance = new C(); |
| 766 } |
| 767 |
| 768 instance.foo(); |
| 769 } |
| 770 """, |
| 771 const <String>['v1']), |
| 772 const ProgramResult( |
| 773 r""" |
| 774 class C { |
| 775 void foo() { |
| 776 print('v2'); |
| 777 } |
| 778 } |
| 779 |
| 780 var instance; |
| 781 |
| 782 main() { |
| 783 if (instance == null) { |
| 784 instance = new C(); |
| 785 } |
| 786 |
| 787 instance.foo(); |
| 788 } |
| 789 """, |
| 790 const <String>['v2']), |
| 791 ], |
| 582 ]; | 792 ]; |
| 583 | 793 |
| 584 void main() { | 794 void main() { |
| 585 listener.start(); | 795 listener.start(); |
| 586 | 796 |
| 587 document.head.append(lineNumberStyle()); | 797 document.head.append(lineNumberStyle()); |
| 588 | 798 |
| 589 return asyncTest(() => Future.forEach(tests, compileAndRun)); | 799 return asyncTest(() => Future.forEach(tests, compileAndRun)); |
| 590 } | 800 } |
| 591 | 801 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 position: absolute; | 908 position: absolute; |
| 699 left: 0px; | 909 left: 0px; |
| 700 width: 3em; | 910 width: 3em; |
| 701 text-align: right; | 911 text-align: right; |
| 702 background-color: lightgoldenrodyellow; | 912 background-color: lightgoldenrodyellow; |
| 703 } | 913 } |
| 704 '''); | 914 '''); |
| 705 style.type = 'text/css'; | 915 style.type = 'text/css'; |
| 706 return style; | 916 return style; |
| 707 } | 917 } |
| OLD | NEW |