| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of dart2js.semantics_visitor_test; | 5 part of dart2js.semantics_visitor_test; |
| 6 | 6 |
| 7 const Map<String, List<Test>> SEND_TESTS = const { | 7 const Map<String, List<Test>> SEND_TESTS = const { |
| 8 'Parameters': const [ | 8 'Parameters': const [ |
| 9 // Parameters | 9 // Parameters |
| 10 const Test('m(o) => o;', | 10 const Test('m(o) => o;', |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 'Local functions': const [ | 53 'Local functions': const [ |
| 54 // Local functions | 54 // Local functions |
| 55 const Test('m() { o(a, b) {}; return o; }', | 55 const Test('m() { o(a, b) {}; return o; }', |
| 56 const Visit(VisitKind.VISIT_LOCAL_FUNCTION_GET, | 56 const Visit(VisitKind.VISIT_LOCAL_FUNCTION_GET, |
| 57 element: 'function(m#o)')), | 57 element: 'function(m#o)')), |
| 58 const Test('m() { o(a, b) {}; o(null, 42); }', | 58 const Test('m() { o(a, b) {}; o(null, 42); }', |
| 59 const Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE, | 59 const Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE, |
| 60 element: 'function(m#o)', | 60 element: 'function(m#o)', |
| 61 arguments: '(null,42)', | 61 arguments: '(null,42)', |
| 62 selector: 'CallStructure(arity=2)')), | 62 selector: 'CallStructure(arity=2)')), |
| 63 const Test('m() { o(a) {}; o(null, 42); }', |
| 64 const Visit(VisitKind.VISIT_LOCAL_FUNCTION_INCOMPATIBLE_INVOKE, |
| 65 element: 'function(m#o)', |
| 66 arguments: '(null,42)', |
| 67 selector: 'CallStructure(arity=2)')), |
| 63 // TODO(johnniwinther): Expect [VISIT_LOCAL_FUNCTION_SET] instead. | 68 // TODO(johnniwinther): Expect [VISIT_LOCAL_FUNCTION_SET] instead. |
| 64 const Test('m() { o(a, b) {}; o = 42; }', | 69 const Test('m() { o(a, b) {}; o = 42; }', |
| 65 const Visit(VisitKind.VISIT_UNRESOLVED_SET, | 70 const Visit(VisitKind.VISIT_UNRESOLVED_SET, |
| 66 name: 'o', | 71 name: 'o', |
| 67 rhs: '42')), | 72 rhs: '42')), |
| 68 ], | 73 ], |
| 69 'Static fields': const [ | 74 'Static fields': const [ |
| 70 // Static fields | 75 // Static fields |
| 71 const Test( | 76 const Test( |
| 72 ''' | 77 ''' |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 ''', | 348 ''', |
| 344 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 349 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 345 name: 'o')), | 350 name: 'o')), |
| 346 const Test.clazz( | 351 const Test.clazz( |
| 347 ''' | 352 ''' |
| 348 class C { | 353 class C { |
| 349 static set o(_) {} | 354 static set o(_) {} |
| 350 m() => o; | 355 m() => o; |
| 351 } | 356 } |
| 352 ''', | 357 ''', |
| 353 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 358 const Visit(VisitKind.VISIT_STATIC_SETTER_GET, |
| 354 name: 'o')), | 359 element: 'setter(C#o)')), |
| 360 |
| 355 const Test.clazz( | 361 const Test.clazz( |
| 356 ''' | 362 ''' |
| 357 class C { | 363 class C { |
| 358 static set o(_) {} | 364 static set o(_) {} |
| 359 m() => C.o; | 365 m() => C.o; |
| 360 } | 366 } |
| 361 ''', | 367 ''', |
| 362 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 368 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 363 name: 'o')), | 369 name: 'o')), |
| 364 const Test.prefix( | 370 const Test.prefix( |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 461 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, |
| 456 name: 'o', | 462 name: 'o', |
| 457 arguments: '(null,42)')), | 463 arguments: '(null,42)')), |
| 458 const Test.clazz( | 464 const Test.clazz( |
| 459 ''' | 465 ''' |
| 460 class C { | 466 class C { |
| 461 static set o(_) {} | 467 static set o(_) {} |
| 462 m() { o(null, 42); } | 468 m() { o(null, 42); } |
| 463 } | 469 } |
| 464 ''', | 470 ''', |
| 465 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 471 const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE, |
| 466 name: 'o', | 472 element: 'setter(C#o)', |
| 467 arguments: '(null,42)')), | 473 arguments: '(null,42)')), |
| 468 const Test.clazz( | 474 const Test.clazz( |
| 469 ''' | 475 ''' |
| 470 class C { | 476 class C { |
| 471 static set o(_) {} | 477 static set o(_) {} |
| 472 m() { C.o(null, 42); } | 478 m() { C.o(null, 42); } |
| 473 } | 479 } |
| 474 ''', | 480 ''', |
| 475 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 481 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, |
| 476 name: 'o', | 482 name: 'o', |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 m() => p.o; | 719 m() => p.o; |
| 714 ''', | 720 ''', |
| 715 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET, | 721 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET, |
| 716 element: 'getter(o)')), | 722 element: 'getter(o)')), |
| 717 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_SETTER_GET] instead. | 723 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_SETTER_GET] instead. |
| 718 const Test( | 724 const Test( |
| 719 ''' | 725 ''' |
| 720 set o(_) {} | 726 set o(_) {} |
| 721 m() => o; | 727 m() => o; |
| 722 ''', | 728 ''', |
| 723 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 729 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET, |
| 724 name: 'o')), | 730 element: 'setter(o)')), |
| 725 const Test.prefix( | 731 const Test.prefix( |
| 726 ''' | 732 ''' |
| 727 set o(_) {} | 733 set o(_) {} |
| 728 ''', | 734 ''', |
| 729 ''' | 735 ''' |
| 730 m() => p.o; | 736 m() => p.o; |
| 731 ''', | 737 ''', |
| 732 const Visit(VisitKind.VISIT_UNRESOLVED_GET, | 738 const Visit(VisitKind.VISIT_UNRESOLVED_GET, |
| 733 name: 'o')), | 739 name: 'o')), |
| 734 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_GETTER_SET] instead. | 740 // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_GETTER_SET] instead. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 'm() { p.o(null, 42); }', | 785 'm() { p.o(null, 42); }', |
| 780 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE, | 786 const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE, |
| 781 element: 'getter(o)', | 787 element: 'getter(o)', |
| 782 arguments: '(null,42)')), | 788 arguments: '(null,42)')), |
| 783 // TODO(johnniwinther): Expected [VISIT_TOP_LEVEL_SETTER_INVOKE] instead. | 789 // TODO(johnniwinther): Expected [VISIT_TOP_LEVEL_SETTER_INVOKE] instead. |
| 784 const Test( | 790 const Test( |
| 785 ''' | 791 ''' |
| 786 set o(_) {} | 792 set o(_) {} |
| 787 m() => o(null, 42); | 793 m() => o(null, 42); |
| 788 ''', | 794 ''', |
| 789 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 795 const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE, |
| 790 name: 'o', | 796 element: 'setter(o)', |
| 791 arguments: '(null,42)')), | 797 arguments: '(null,42)')), |
| 792 const Test.prefix( | 798 const Test.prefix( |
| 793 ''' | 799 ''' |
| 794 set o(_) {} | 800 set o(_) {} |
| 795 ''', | 801 ''', |
| 796 'm() { p.o(null, 42); }', | 802 'm() { p.o(null, 42); }', |
| 797 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, | 803 const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE, |
| 798 name: 'o', | 804 name: 'o', |
| 799 arguments: '(null,42)')), | 805 arguments: '(null,42)')), |
| 800 ], | 806 ], |
| (...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3503 ''' | 3509 ''' |
| 3504 m(a) => a ??= 42; | 3510 m(a) => a ??= 42; |
| 3505 ''', | 3511 ''', |
| 3506 const Visit( | 3512 const Visit( |
| 3507 VisitKind.VISIT_PARAMETER_COMPOUND, | 3513 VisitKind.VISIT_PARAMETER_COMPOUND, |
| 3508 element: 'parameter(m#a)', | 3514 element: 'parameter(m#a)', |
| 3509 operator: '??=', | 3515 operator: '??=', |
| 3510 rhs: '42')), | 3516 rhs: '42')), |
| 3511 ], | 3517 ], |
| 3512 }; | 3518 }; |
| OLD | NEW |