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 library dart2js.semantics_visitor; | 5 library dart2js.semantics_visitor; |
6 | 6 |
7 import '../constants/expressions.dart'; | 7 import '../constants/expressions.dart'; |
8 import '../dart2jslib.dart' show invariant; | 8 import '../dart2jslib.dart' show invariant; |
9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 /// m() { super.foo(null, 42); } | 505 /// m() { super.foo(null, 42); } |
506 /// } | 506 /// } |
507 /// | 507 /// |
508 R visitSuperMethodInvoke( | 508 R visitSuperMethodInvoke( |
509 Send node, | 509 Send node, |
510 MethodElement method, | 510 MethodElement method, |
511 NodeList arguments, | 511 NodeList arguments, |
512 CallStructure callStructure, | 512 CallStructure callStructure, |
513 A arg); | 513 A arg); |
514 | 514 |
| 515 /// Invocation of the super [method] with incompatible [arguments]. |
| 516 /// |
| 517 /// For instance |
| 518 /// class B { |
| 519 /// foo(a, b) {} |
| 520 /// } |
| 521 /// class C extends B { |
| 522 /// m() { super.foo(null); } // One argument missing. |
| 523 /// } |
| 524 /// |
| 525 R visitSuperMethodIncompatibleInvoke( |
| 526 Send node, |
| 527 MethodElement method, |
| 528 NodeList arguments, |
| 529 CallStructure callStructure, |
| 530 A arg); |
| 531 |
515 /// Assignment of [rhs] to the super [method]. | 532 /// Assignment of [rhs] to the super [method]. |
516 /// | 533 /// |
517 /// For instance | 534 /// For instance |
518 /// class B { | 535 /// class B { |
519 /// foo(a, b) {} | 536 /// foo(a, b) {} |
520 /// } | 537 /// } |
521 /// class C extends B { | 538 /// class C extends B { |
522 /// m() { super.foo = rhs; } | 539 /// m() { super.foo = rhs; } |
523 /// } | 540 /// } |
524 /// | 541 /// |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 A arg); | 1292 A arg); |
1276 | 1293 |
1277 /// Index expression `super[index]` where 'operator []' is unresolved. | 1294 /// Index expression `super[index]` where 'operator []' is unresolved. |
1278 /// | 1295 /// |
1279 /// For instance: | 1296 /// For instance: |
1280 /// class B {} | 1297 /// class B {} |
1281 /// class C extends B { | 1298 /// class C extends B { |
1282 /// m(a) => super[a]; | 1299 /// m(a) => super[a]; |
1283 /// } | 1300 /// } |
1284 /// | 1301 /// |
1285 R errorUnresolvedSuperIndex( | 1302 R visitUnresolvedSuperIndex( |
1286 Send node, | 1303 Send node, |
1287 Element element, | 1304 Element element, |
1288 Node index, | 1305 Node index, |
1289 A arg); | 1306 A arg); |
1290 | 1307 |
1291 /// Prefix operation on an index expression `operator super[index]` where | 1308 /// Prefix operation on an index expression `operator super[index]` where |
1292 /// 'operator []' or 'operator []=' is unresolved and the operation | 1309 /// 'operator []' or 'operator []=' is unresolved and the operation |
1293 /// is defined by [operator]. | 1310 /// is defined by [operator]. |
1294 /// | 1311 /// |
1295 /// For instance: | 1312 /// For instance: |
(...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 /// m5() => unresolved.Foo.bar; | 2680 /// m5() => unresolved.Foo.bar; |
2664 /// m6() => C.unresolved; | 2681 /// m6() => C.unresolved; |
2665 /// m7() => prefix.C.unresolved; | 2682 /// m7() => prefix.C.unresolved; |
2666 /// | 2683 /// |
2667 // TODO(johnniwinther): Split the cases in which a prefix is resolved. | 2684 // TODO(johnniwinther): Split the cases in which a prefix is resolved. |
2668 R errorUnresolvedGet( | 2685 R errorUnresolvedGet( |
2669 Send node, | 2686 Send node, |
2670 Element element, | 2687 Element element, |
2671 A arg); | 2688 A arg); |
2672 | 2689 |
| 2690 /// Read of the unresolved super [element]. |
| 2691 /// |
| 2692 /// For instance |
| 2693 /// class B {} |
| 2694 /// class C { |
| 2695 /// m() => super.foo; |
| 2696 /// } |
| 2697 /// |
| 2698 R visitUnresolvedSuperGet( |
| 2699 Send node, |
| 2700 Element element, |
| 2701 A arg); |
| 2702 |
2673 /// Assignment of [rhs] to the unresolved [element]. | 2703 /// Assignment of [rhs] to the unresolved [element]. |
2674 /// | 2704 /// |
2675 /// For instance | 2705 /// For instance |
2676 /// class C {} | 2706 /// class C {} |
2677 /// m1() => unresolved = 42; | 2707 /// m1() => unresolved = 42; |
2678 /// m2() => prefix.unresolved = 42; | 2708 /// m2() => prefix.unresolved = 42; |
2679 /// m3() => Unresolved.foo = 42; | 2709 /// m3() => Unresolved.foo = 42; |
2680 /// m4() => unresolved.foo = 42; | 2710 /// m4() => unresolved.foo = 42; |
2681 /// m5() => unresolved.Foo.bar = 42; | 2711 /// m5() => unresolved.Foo.bar = 42; |
2682 /// m6() => C.unresolved = 42; | 2712 /// m6() => C.unresolved = 42; |
(...skipping 19 matching lines...) Expand all Loading... |
2702 /// m7() => prefix.C.unresolved(null, 42); | 2732 /// m7() => prefix.C.unresolved(null, 42); |
2703 /// | 2733 /// |
2704 // TODO(johnniwinther): Split the cases in which a prefix is resolved. | 2734 // TODO(johnniwinther): Split the cases in which a prefix is resolved. |
2705 R errorUnresolvedInvoke( | 2735 R errorUnresolvedInvoke( |
2706 Send node, | 2736 Send node, |
2707 Element element, | 2737 Element element, |
2708 NodeList arguments, | 2738 NodeList arguments, |
2709 Selector selector, | 2739 Selector selector, |
2710 A arg); | 2740 A arg); |
2711 | 2741 |
| 2742 /// Invocation of the unresolved super [element] with [arguments]. |
| 2743 /// |
| 2744 /// For instance |
| 2745 /// class B {} |
| 2746 /// class C extends B { |
| 2747 /// m() => super.foo(); |
| 2748 /// } |
| 2749 /// |
| 2750 R visitUnresolvedSuperInvoke( |
| 2751 Send node, |
| 2752 Element element, |
| 2753 NodeList arguments, |
| 2754 Selector selector, |
| 2755 A arg); |
| 2756 |
2712 /// Compound assignment of [rhs] on the unresolved [element]. | 2757 /// Compound assignment of [rhs] on the unresolved [element]. |
2713 /// | 2758 /// |
2714 /// For instance | 2759 /// For instance |
2715 /// class C {} | 2760 /// class C {} |
2716 /// m1() => unresolved += 42; | 2761 /// m1() => unresolved += 42; |
2717 /// m2() => prefix.unresolved += 42; | 2762 /// m2() => prefix.unresolved += 42; |
2718 /// m3() => Unresolved.foo += 42; | 2763 /// m3() => Unresolved.foo += 42; |
2719 /// m4() => unresolved.foo += 42; | 2764 /// m4() => unresolved.foo += 42; |
2720 /// m5() => unresolved.Foo.bar += 42; | 2765 /// m5() => unresolved.Foo.bar += 42; |
2721 /// m6() => C.unresolved += 42; | 2766 /// m6() => C.unresolved += 42; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2803 | 2848 |
2804 /// Unary operation on the unresolved super [element]. | 2849 /// Unary operation on the unresolved super [element]. |
2805 /// | 2850 /// |
2806 /// For instance | 2851 /// For instance |
2807 /// class B { | 2852 /// class B { |
2808 /// } | 2853 /// } |
2809 /// class C extends B { | 2854 /// class C extends B { |
2810 /// m() => -super; | 2855 /// m() => -super; |
2811 /// } | 2856 /// } |
2812 /// | 2857 /// |
2813 R errorUnresolvedSuperUnary( | 2858 R visitUnresolvedSuperUnary( |
2814 Send node, | 2859 Send node, |
2815 UnaryOperator operator, | 2860 UnaryOperator operator, |
2816 Element element, | 2861 Element element, |
2817 A arg); | 2862 A arg); |
2818 | 2863 |
2819 /// Binary operation on the unresolved super [element]. | 2864 /// Binary operation on the unresolved super [element]. |
2820 /// | 2865 /// |
2821 /// For instance | 2866 /// For instance |
2822 /// class B { | 2867 /// class B { |
2823 /// } | 2868 /// } |
2824 /// class C extends B { | 2869 /// class C extends B { |
2825 /// m() => super + 42; | 2870 /// m() => super + 42; |
2826 /// } | 2871 /// } |
2827 /// | 2872 /// |
2828 R errorUnresolvedSuperBinary( | 2873 R visitUnresolvedSuperBinary( |
2829 Send node, | 2874 Send node, |
2830 Element element, | 2875 Element element, |
2831 BinaryOperator operator, | 2876 BinaryOperator operator, |
2832 Node argument, | 2877 Node argument, |
2833 A arg); | 2878 A arg); |
2834 | 2879 |
2835 /// Invocation of an undefined unary [operator] on [expression]. | 2880 /// Invocation of an undefined unary [operator] on [expression]. |
2836 R errorUndefinedUnaryExpression( | 2881 R errorUndefinedUnaryExpression( |
2837 Send node, | 2882 Send node, |
2838 Operator operator, | 2883 Operator operator, |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3555 /// C() : this._(42); | 3600 /// C() : this._(42); |
3556 /// } | 3601 /// } |
3557 /// | 3602 /// |
3558 R errorUnresolvedThisConstructorInvoke( | 3603 R errorUnresolvedThisConstructorInvoke( |
3559 Send node, | 3604 Send node, |
3560 Element element, | 3605 Element element, |
3561 NodeList arguments, | 3606 NodeList arguments, |
3562 Selector selector, | 3607 Selector selector, |
3563 A arg); | 3608 A arg); |
3564 } | 3609 } |
OLD | NEW |