| 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 A arg); | 893 A arg); |
| 894 | 894 |
| 895 /// Read of the type literal for class [element]. | 895 /// Read of the type literal for class [element]. |
| 896 /// | 896 /// |
| 897 /// For instance | 897 /// For instance |
| 898 /// class C {} | 898 /// class C {} |
| 899 /// m() => C; | 899 /// m() => C; |
| 900 /// | 900 /// |
| 901 R visitClassTypeLiteralGet( | 901 R visitClassTypeLiteralGet( |
| 902 Send node, | 902 Send node, |
| 903 TypeConstantExpression constant, | 903 ConstantExpression constant, |
| 904 A arg); | 904 A arg); |
| 905 | 905 |
| 906 /// Invocation of the type literal for class [element] with [arguments]. | 906 /// Invocation of the type literal for class [element] with [arguments]. |
| 907 /// | 907 /// |
| 908 /// For instance | 908 /// For instance |
| 909 /// class C {} | 909 /// class C {} |
| 910 /// m() => C(null, 42); | 910 /// m() => C(null, 42); |
| 911 /// | 911 /// |
| 912 R visitClassTypeLiteralInvoke( | 912 R visitClassTypeLiteralInvoke( |
| 913 Send node, | 913 Send node, |
| 914 TypeConstantExpression constant, | 914 ConstantExpression constant, |
| 915 NodeList arguments, | 915 NodeList arguments, |
| 916 Selector selector, | 916 Selector selector, |
| 917 A arg); | 917 A arg); |
| 918 | 918 |
| 919 /// Assignment of [rhs] to the type literal for class [element]. | 919 /// Assignment of [rhs] to the type literal for class [element]. |
| 920 /// | 920 /// |
| 921 /// For instance | 921 /// For instance |
| 922 /// class C {} | 922 /// class C {} |
| 923 /// m() { C = rhs; } | 923 /// m() { C = rhs; } |
| 924 /// | 924 /// |
| 925 R errorClassTypeLiteralSet( | 925 R errorClassTypeLiteralSet( |
| 926 SendSet node, | 926 SendSet node, |
| 927 TypeConstantExpression constant, | 927 ConstantExpression constant, |
| 928 Node rhs, | 928 Node rhs, |
| 929 A arg); | 929 A arg); |
| 930 | 930 |
| 931 /// Read of the type literal for typedef [element]. | 931 /// Read of the type literal for typedef [element]. |
| 932 /// | 932 /// |
| 933 /// For instance | 933 /// For instance |
| 934 /// typedef F(); | 934 /// typedef F(); |
| 935 /// m() => F; | 935 /// m() => F; |
| 936 /// | 936 /// |
| 937 R visitTypedefTypeLiteralGet( | 937 R visitTypedefTypeLiteralGet( |
| 938 Send node, | 938 Send node, |
| 939 TypeConstantExpression constant, | 939 ConstantExpression constant, |
| 940 A arg); | 940 A arg); |
| 941 | 941 |
| 942 /// Invocation of the type literal for typedef [element] with [arguments]. | 942 /// Invocation of the type literal for typedef [element] with [arguments]. |
| 943 /// | 943 /// |
| 944 /// For instance | 944 /// For instance |
| 945 /// typedef F(); | 945 /// typedef F(); |
| 946 /// m() => F(null, 42); | 946 /// m() => F(null, 42); |
| 947 /// | 947 /// |
| 948 R visitTypedefTypeLiteralInvoke( | 948 R visitTypedefTypeLiteralInvoke( |
| 949 Send node, | 949 Send node, |
| 950 TypeConstantExpression constant, | 950 ConstantExpression constant, |
| 951 NodeList arguments, | 951 NodeList arguments, |
| 952 Selector selector, | 952 Selector selector, |
| 953 A arg); | 953 A arg); |
| 954 | 954 |
| 955 /// Assignment of [rhs] to the type literal for typedef [element]. | 955 /// Assignment of [rhs] to the type literal for typedef [element]. |
| 956 /// | 956 /// |
| 957 /// For instance | 957 /// For instance |
| 958 /// typedef F(); | 958 /// typedef F(); |
| 959 /// m() { F = rhs; } | 959 /// m() { F = rhs; } |
| 960 /// | 960 /// |
| 961 R errorTypedefTypeLiteralSet( | 961 R errorTypedefTypeLiteralSet( |
| 962 SendSet node, | 962 SendSet node, |
| 963 TypeConstantExpression constant, | 963 ConstantExpression constant, |
| 964 Node rhs, | 964 Node rhs, |
| 965 A arg); | 965 A arg); |
| 966 | 966 |
| 967 /// Read of the type literal for type variable [element]. | 967 /// Read of the type literal for type variable [element]. |
| 968 /// | 968 /// |
| 969 /// For instance | 969 /// For instance |
| 970 /// class C<T> { | 970 /// class C<T> { |
| 971 /// m() => T; | 971 /// m() => T; |
| 972 /// } | 972 /// } |
| 973 /// | 973 /// |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1004 Node rhs, | 1004 Node rhs, |
| 1005 A arg); | 1005 A arg); |
| 1006 | 1006 |
| 1007 /// Read of the type literal for `dynamic`. | 1007 /// Read of the type literal for `dynamic`. |
| 1008 /// | 1008 /// |
| 1009 /// For instance | 1009 /// For instance |
| 1010 /// m() => dynamic; | 1010 /// m() => dynamic; |
| 1011 /// | 1011 /// |
| 1012 R visitDynamicTypeLiteralGet( | 1012 R visitDynamicTypeLiteralGet( |
| 1013 Send node, | 1013 Send node, |
| 1014 TypeConstantExpression constant, | 1014 ConstantExpression constant, |
| 1015 A arg); | 1015 A arg); |
| 1016 | 1016 |
| 1017 /// Invocation of the type literal for `dynamic` with [arguments]. | 1017 /// Invocation of the type literal for `dynamic` with [arguments]. |
| 1018 /// | 1018 /// |
| 1019 /// For instance | 1019 /// For instance |
| 1020 /// m() { dynamic(null, 42); } | 1020 /// m() { dynamic(null, 42); } |
| 1021 /// | 1021 /// |
| 1022 R visitDynamicTypeLiteralInvoke( | 1022 R visitDynamicTypeLiteralInvoke( |
| 1023 Send node, | 1023 Send node, |
| 1024 TypeConstantExpression constant, | 1024 ConstantExpression constant, |
| 1025 NodeList arguments, | 1025 NodeList arguments, |
| 1026 Selector selector, | 1026 Selector selector, |
| 1027 A arg); | 1027 A arg); |
| 1028 | 1028 |
| 1029 /// Assignment of [rhs] to the type literal for `dynamic`. | 1029 /// Assignment of [rhs] to the type literal for `dynamic`. |
| 1030 /// | 1030 /// |
| 1031 /// For instance | 1031 /// For instance |
| 1032 /// m() { dynamic = rhs; } | 1032 /// m() { dynamic = rhs; } |
| 1033 /// | 1033 /// |
| 1034 R errorDynamicTypeLiteralSet( | 1034 R errorDynamicTypeLiteralSet( |
| 1035 SendSet node, | 1035 SendSet node, |
| 1036 TypeConstantExpression constant, | 1036 ConstantExpression constant, |
| 1037 Node rhs, | 1037 Node rhs, |
| 1038 A arg); | 1038 A arg); |
| 1039 | 1039 |
| 1040 /// Call to `assert` with [expression] as the condition. | 1040 /// Call to `assert` with [expression] as the condition. |
| 1041 /// | 1041 /// |
| 1042 /// For instance: | 1042 /// For instance: |
| 1043 /// m() { assert(expression); } | 1043 /// m() { assert(expression); } |
| 1044 /// | 1044 /// |
| 1045 R visitAssert( | 1045 R visitAssert( |
| 1046 Send node, | 1046 Send node, |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 | 1787 |
| 1788 /// Compound assignment expression of [rhs] with [operator] on a type literal | 1788 /// Compound assignment expression of [rhs] with [operator] on a type literal |
| 1789 /// for class [element]. | 1789 /// for class [element]. |
| 1790 /// | 1790 /// |
| 1791 /// For instance: | 1791 /// For instance: |
| 1792 /// class C {} | 1792 /// class C {} |
| 1793 /// m(rhs) => C += rhs; | 1793 /// m(rhs) => C += rhs; |
| 1794 /// | 1794 /// |
| 1795 R errorClassTypeLiteralCompound( | 1795 R errorClassTypeLiteralCompound( |
| 1796 Send node, | 1796 Send node, |
| 1797 TypeConstantExpression constant, | 1797 ConstantExpression constant, |
| 1798 AssignmentOperator operator, | 1798 AssignmentOperator operator, |
| 1799 Node rhs, | 1799 Node rhs, |
| 1800 A arg); | 1800 A arg); |
| 1801 | 1801 |
| 1802 /// Compound assignment expression of [rhs] with [operator] on a type literal | 1802 /// Compound assignment expression of [rhs] with [operator] on a type literal |
| 1803 /// for typedef [element]. | 1803 /// for typedef [element]. |
| 1804 /// | 1804 /// |
| 1805 /// For instance: | 1805 /// For instance: |
| 1806 /// typedef F(); | 1806 /// typedef F(); |
| 1807 /// m(rhs) => F += rhs; | 1807 /// m(rhs) => F += rhs; |
| 1808 /// | 1808 /// |
| 1809 R errorTypedefTypeLiteralCompound( | 1809 R errorTypedefTypeLiteralCompound( |
| 1810 Send node, | 1810 Send node, |
| 1811 TypeConstantExpression constant, | 1811 ConstantExpression constant, |
| 1812 AssignmentOperator operator, | 1812 AssignmentOperator operator, |
| 1813 Node rhs, | 1813 Node rhs, |
| 1814 A arg); | 1814 A arg); |
| 1815 | 1815 |
| 1816 /// Compound assignment expression of [rhs] with [operator] on a type literal | 1816 /// Compound assignment expression of [rhs] with [operator] on a type literal |
| 1817 /// for type variable [element]. | 1817 /// for type variable [element]. |
| 1818 /// | 1818 /// |
| 1819 /// For instance: | 1819 /// For instance: |
| 1820 /// class C<T> { | 1820 /// class C<T> { |
| 1821 /// m(rhs) => T += rhs; | 1821 /// m(rhs) => T += rhs; |
| 1822 /// } | 1822 /// } |
| 1823 /// | 1823 /// |
| 1824 R errorTypeVariableTypeLiteralCompound( | 1824 R errorTypeVariableTypeLiteralCompound( |
| 1825 Send node, | 1825 Send node, |
| 1826 TypeVariableElement element, | 1826 TypeVariableElement element, |
| 1827 AssignmentOperator operator, | 1827 AssignmentOperator operator, |
| 1828 Node rhs, | 1828 Node rhs, |
| 1829 A arg); | 1829 A arg); |
| 1830 | 1830 |
| 1831 /// Compound assignment expression of [rhs] with [operator] on the type | 1831 /// Compound assignment expression of [rhs] with [operator] on the type |
| 1832 /// literal for `dynamic`. | 1832 /// literal for `dynamic`. |
| 1833 /// | 1833 /// |
| 1834 /// For instance: | 1834 /// For instance: |
| 1835 /// m(rhs) => dynamic += rhs; | 1835 /// m(rhs) => dynamic += rhs; |
| 1836 /// | 1836 /// |
| 1837 R errorDynamicTypeLiteralCompound( | 1837 R errorDynamicTypeLiteralCompound( |
| 1838 Send node, | 1838 Send node, |
| 1839 TypeConstantExpression constant, | 1839 ConstantExpression constant, |
| 1840 AssignmentOperator operator, | 1840 AssignmentOperator operator, |
| 1841 Node rhs, | 1841 Node rhs, |
| 1842 A arg); | 1842 A arg); |
| 1843 | 1843 |
| 1844 /// Compound assignment expression of [rhs] with [operator] on the index | 1844 /// Compound assignment expression of [rhs] with [operator] on the index |
| 1845 /// operators of [receiver] whose getter and setter are defined by | 1845 /// operators of [receiver] whose getter and setter are defined by |
| 1846 /// [getterSelector] and [setterSelector], respectively. | 1846 /// [getterSelector] and [setterSelector], respectively. |
| 1847 /// | 1847 /// |
| 1848 /// For instance: | 1848 /// For instance: |
| 1849 /// m(receiver, index, rhs) => receiver[index] += rhs; | 1849 /// m(receiver, index, rhs) => receiver[index] += rhs; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 A arg); | 2162 A arg); |
| 2163 | 2163 |
| 2164 /// Prefix expression with [operator] on a type literal for a class [element]. | 2164 /// Prefix expression with [operator] on a type literal for a class [element]. |
| 2165 /// | 2165 /// |
| 2166 /// For instance: | 2166 /// For instance: |
| 2167 /// class C {} | 2167 /// class C {} |
| 2168 /// m() => ++C; | 2168 /// m() => ++C; |
| 2169 /// | 2169 /// |
| 2170 R errorClassTypeLiteralPrefix( | 2170 R errorClassTypeLiteralPrefix( |
| 2171 Send node, | 2171 Send node, |
| 2172 TypeConstantExpression constant, | 2172 ConstantExpression constant, |
| 2173 IncDecOperator operator, | 2173 IncDecOperator operator, |
| 2174 A arg); | 2174 A arg); |
| 2175 | 2175 |
| 2176 /// Prefix expression with [operator] on a type literal for a typedef | 2176 /// Prefix expression with [operator] on a type literal for a typedef |
| 2177 /// [element]. | 2177 /// [element]. |
| 2178 /// | 2178 /// |
| 2179 /// For instance: | 2179 /// For instance: |
| 2180 /// typedef F(); | 2180 /// typedef F(); |
| 2181 /// m() => ++F; | 2181 /// m() => ++F; |
| 2182 /// | 2182 /// |
| 2183 R errorTypedefTypeLiteralPrefix( | 2183 R errorTypedefTypeLiteralPrefix( |
| 2184 Send node, | 2184 Send node, |
| 2185 TypeConstantExpression constant, | 2185 ConstantExpression constant, |
| 2186 IncDecOperator operator, | 2186 IncDecOperator operator, |
| 2187 A arg); | 2187 A arg); |
| 2188 | 2188 |
| 2189 /// Prefix expression with [operator] on a type literal for a type variable | 2189 /// Prefix expression with [operator] on a type literal for a type variable |
| 2190 /// [element]. | 2190 /// [element]. |
| 2191 /// | 2191 /// |
| 2192 /// For instance: | 2192 /// For instance: |
| 2193 /// class C<T> { | 2193 /// class C<T> { |
| 2194 /// m() => ++T; | 2194 /// m() => ++T; |
| 2195 /// } | 2195 /// } |
| 2196 /// | 2196 /// |
| 2197 R errorTypeVariableTypeLiteralPrefix( | 2197 R errorTypeVariableTypeLiteralPrefix( |
| 2198 Send node, | 2198 Send node, |
| 2199 TypeVariableElement element, | 2199 TypeVariableElement element, |
| 2200 IncDecOperator operator, | 2200 IncDecOperator operator, |
| 2201 A arg); | 2201 A arg); |
| 2202 | 2202 |
| 2203 /// Prefix expression with [operator] on the type literal for `dynamic`. | 2203 /// Prefix expression with [operator] on the type literal for `dynamic`. |
| 2204 /// | 2204 /// |
| 2205 /// For instance: | 2205 /// For instance: |
| 2206 /// m() => ++dynamic; | 2206 /// m() => ++dynamic; |
| 2207 /// | 2207 /// |
| 2208 R errorDynamicTypeLiteralPrefix( | 2208 R errorDynamicTypeLiteralPrefix( |
| 2209 Send node, | 2209 Send node, |
| 2210 TypeConstantExpression constant, | 2210 ConstantExpression constant, |
| 2211 IncDecOperator operator, | 2211 IncDecOperator operator, |
| 2212 A arg); | 2212 A arg); |
| 2213 | 2213 |
| 2214 /// Postfix expression with [operator] of the property on [receiver] whose | 2214 /// Postfix expression with [operator] of the property on [receiver] whose |
| 2215 /// getter and setter are defined by [getterSelector] and [setterSelector], | 2215 /// getter and setter are defined by [getterSelector] and [setterSelector], |
| 2216 /// respectively. | 2216 /// respectively. |
| 2217 /// | 2217 /// |
| 2218 /// For instance: | 2218 /// For instance: |
| 2219 /// m(receiver) => receiver.foo++; | 2219 /// m(receiver) => receiver.foo++; |
| 2220 /// | 2220 /// |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2497 | 2497 |
| 2498 /// Postfix expression with [operator] on a type literal for a class | 2498 /// Postfix expression with [operator] on a type literal for a class |
| 2499 /// [element]. | 2499 /// [element]. |
| 2500 /// | 2500 /// |
| 2501 /// For instance: | 2501 /// For instance: |
| 2502 /// class C {} | 2502 /// class C {} |
| 2503 /// m() => C++; | 2503 /// m() => C++; |
| 2504 /// | 2504 /// |
| 2505 R errorClassTypeLiteralPostfix( | 2505 R errorClassTypeLiteralPostfix( |
| 2506 Send node, | 2506 Send node, |
| 2507 TypeConstantExpression constant, | 2507 ConstantExpression constant, |
| 2508 IncDecOperator operator, | 2508 IncDecOperator operator, |
| 2509 A arg); | 2509 A arg); |
| 2510 | 2510 |
| 2511 /// Postfix expression with [operator] on a type literal for a typedef | 2511 /// Postfix expression with [operator] on a type literal for a typedef |
| 2512 /// [element]. | 2512 /// [element]. |
| 2513 /// | 2513 /// |
| 2514 /// For instance: | 2514 /// For instance: |
| 2515 /// typedef F(); | 2515 /// typedef F(); |
| 2516 /// m() => F++; | 2516 /// m() => F++; |
| 2517 /// | 2517 /// |
| 2518 R errorTypedefTypeLiteralPostfix( | 2518 R errorTypedefTypeLiteralPostfix( |
| 2519 Send node, | 2519 Send node, |
| 2520 TypeConstantExpression constant, | 2520 ConstantExpression constant, |
| 2521 IncDecOperator operator, | 2521 IncDecOperator operator, |
| 2522 A arg); | 2522 A arg); |
| 2523 | 2523 |
| 2524 /// Postfix expression with [operator] on a type literal for a type variable | 2524 /// Postfix expression with [operator] on a type literal for a type variable |
| 2525 /// [element]. | 2525 /// [element]. |
| 2526 /// | 2526 /// |
| 2527 /// For instance: | 2527 /// For instance: |
| 2528 /// class C<T> { | 2528 /// class C<T> { |
| 2529 /// m() => T++; | 2529 /// m() => T++; |
| 2530 /// } | 2530 /// } |
| 2531 /// | 2531 /// |
| 2532 R errorTypeVariableTypeLiteralPostfix( | 2532 R errorTypeVariableTypeLiteralPostfix( |
| 2533 Send node, | 2533 Send node, |
| 2534 TypeVariableElement element, | 2534 TypeVariableElement element, |
| 2535 IncDecOperator operator, | 2535 IncDecOperator operator, |
| 2536 A arg); | 2536 A arg); |
| 2537 | 2537 |
| 2538 /// Postfix expression with [operator] on the type literal for `dynamic`. | 2538 /// Postfix expression with [operator] on the type literal for `dynamic`. |
| 2539 /// | 2539 /// |
| 2540 /// For instance: | 2540 /// For instance: |
| 2541 /// m() => dynamic++; | 2541 /// m() => dynamic++; |
| 2542 /// | 2542 /// |
| 2543 R errorDynamicTypeLiteralPostfix( | 2543 R errorDynamicTypeLiteralPostfix( |
| 2544 Send node, | 2544 Send node, |
| 2545 TypeConstantExpression constant, | 2545 ConstantExpression constant, |
| 2546 IncDecOperator operator, | 2546 IncDecOperator operator, |
| 2547 A arg); | 2547 A arg); |
| 2548 | 2548 |
| 2549 /// Read of the [constant]. | 2549 /// Read of the [constant]. |
| 2550 /// | 2550 /// |
| 2551 /// For instance | 2551 /// For instance |
| 2552 /// const c = c; | 2552 /// const c = c; |
| 2553 /// m() => c; | 2553 /// m() => c; |
| 2554 /// | 2554 /// |
| 2555 R visitConstantGet( | 2555 R visitConstantGet( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2759 | 2759 |
| 2760 /// Invocation of an undefined unary [operator] with operands | 2760 /// Invocation of an undefined unary [operator] with operands |
| 2761 /// [left] and [right]. | 2761 /// [left] and [right]. |
| 2762 R errorUndefinedBinaryExpression( | 2762 R errorUndefinedBinaryExpression( |
| 2763 Send node, | 2763 Send node, |
| 2764 Node left, | 2764 Node left, |
| 2765 Operator operator, | 2765 Operator operator, |
| 2766 Node right, | 2766 Node right, |
| 2767 A arg); | 2767 A arg); |
| 2768 } | 2768 } |
| OLD | NEW |