| 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; | 5 part of dart2js.semantics_visitor; |
| 6 | 6 |
| 7 /// Interface for bulk handling of a [Node] in a semantic visitor. | 7 /// Interface for bulk handling of a [Node] in a semantic visitor. |
| 8 abstract class BulkHandle<R, A> { | 8 abstract class BulkHandle<R, A> { |
| 9 /// Handle [node] either regardless of semantics or to report that [node] is | 9 /// Handle [node] either regardless of semantics or to report that [node] is |
| 10 /// unhandled. [message] contains a message template for the latter case: | 10 /// unhandled. [message] contains a message template for the latter case: |
| 11 /// Replace '#' in [message] by `node.toString()` to create a message for the | 11 /// Replace '#' in [message] by `node.toString()` to create a message for the |
| 12 /// error. | 12 /// error. |
| 13 R bulkHandleNode(Node node, String message, A arg); | 13 R bulkHandleNode(Node node, String message, A arg); |
| 14 } | 14 } |
| 15 | 15 |
| 16 /// Mixin that implements all `errorX` methods of [SemanticSendVisitor] by | 16 /// Mixin that implements all `errorX` methods of [SemanticSendVisitor] by |
| 17 /// delegating to a bulk handler. | 17 /// delegating to a bulk handler. |
| 18 /// | 18 /// |
| 19 /// Use this mixin to provide a trivial implementation for all `errorX` methods. | 19 /// Use this mixin to provide a trivial implementation for all `errorX` methods. |
| 20 abstract class ErrorBulkMixin<R, A> | 20 abstract class ErrorBulkMixin<R, A> |
| 21 implements SemanticSendVisitor<R, A>, BulkHandle<R, A> { | 21 implements SemanticSendVisitor<R, A>, BulkHandle<R, A> { |
| 22 // TODO(johnniwinther): Ensure that all error methods have an | 22 // TODO(johnniwinther): Ensure that all error methods have an |
| 23 // [ErroneousElement]. | 23 // [ErroneousElement]. |
| 24 R bulkHandleError(Node node, ErroneousElement error, A arg) { | 24 R bulkHandleError(Node node, ErroneousElement error, A arg) { |
| 25 return bulkHandleNode(node, "Error expression `#` unhandled.", arg); | 25 return bulkHandleNode(node, "Error expression `#` unhandled.", arg); |
| 26 } | 26 } |
| 27 | 27 |
| 28 @override | 28 @override |
| 29 R errorNonConstantConstructorInvoke(NewExpression node, Element element, | 29 R errorNonConstantConstructorInvoke( |
| 30 DartType type, NodeList arguments, CallStructure callStructure, A arg) { | 30 NewExpression node, |
| 31 Element element, |
| 32 ResolutionDartType type, |
| 33 NodeList arguments, |
| 34 CallStructure callStructure, |
| 35 A arg) { |
| 31 return bulkHandleError(node, null, arg); | 36 return bulkHandleError(node, null, arg); |
| 32 } | 37 } |
| 33 | 38 |
| 34 @override | 39 @override |
| 35 R errorUndefinedUnaryExpression( | 40 R errorUndefinedUnaryExpression( |
| 36 Send node, Operator operator, Node expression, A arg) { | 41 Send node, Operator operator, Node expression, A arg) { |
| 37 return bulkHandleError(node, null, arg); | 42 return bulkHandleError(node, null, arg); |
| 38 } | 43 } |
| 39 | 44 |
| 40 @override | 45 @override |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 } | 1911 } |
| 1907 | 1912 |
| 1908 /// Mixin that implements all purely structural visitor methods in | 1913 /// Mixin that implements all purely structural visitor methods in |
| 1909 /// [SemanticSendVisitor] by delegating to a bulk handler. | 1914 /// [SemanticSendVisitor] by delegating to a bulk handler. |
| 1910 /// | 1915 /// |
| 1911 /// Use this mixin to provide a trivial implementation for all purely structural | 1916 /// Use this mixin to provide a trivial implementation for all purely structural |
| 1912 /// visitor methods. | 1917 /// visitor methods. |
| 1913 abstract class BaseBulkMixin<R, A> | 1918 abstract class BaseBulkMixin<R, A> |
| 1914 implements SemanticSendVisitor<R, A>, BulkHandle<R, A> { | 1919 implements SemanticSendVisitor<R, A>, BulkHandle<R, A> { |
| 1915 @override | 1920 @override |
| 1916 R visitAs(Send node, Node expression, DartType type, A arg) { | 1921 R visitAs(Send node, Node expression, ResolutionDartType type, A arg) { |
| 1917 return bulkHandleNode(node, 'As cast `#` unhandled.', arg); | 1922 return bulkHandleNode(node, 'As cast `#` unhandled.', arg); |
| 1918 } | 1923 } |
| 1919 | 1924 |
| 1920 @override | 1925 @override |
| 1921 R visitIs(Send node, Node expression, DartType type, A arg) { | 1926 R visitIs(Send node, Node expression, ResolutionDartType type, A arg) { |
| 1922 return bulkHandleNode(node, 'Is test `#` unhandled.', arg); | 1927 return bulkHandleNode(node, 'Is test `#` unhandled.', arg); |
| 1923 } | 1928 } |
| 1924 | 1929 |
| 1925 @override | 1930 @override |
| 1926 R visitIsNot(Send node, Node expression, DartType type, A arg) { | 1931 R visitIsNot(Send node, Node expression, ResolutionDartType type, A arg) { |
| 1927 return bulkHandleNode(node, 'Is not test `#` unhandled.', arg); | 1932 return bulkHandleNode(node, 'Is not test `#` unhandled.', arg); |
| 1928 } | 1933 } |
| 1929 | 1934 |
| 1930 @override | 1935 @override |
| 1931 R visitIfNull(Send node, Node left, Node right, A arg) { | 1936 R visitIfNull(Send node, Node left, Node right, A arg) { |
| 1932 return bulkHandleNode(node, 'If-null (Lazy ?? `#`) unhandled.', arg); | 1937 return bulkHandleNode(node, 'If-null (Lazy ?? `#`) unhandled.', arg); |
| 1933 } | 1938 } |
| 1934 | 1939 |
| 1935 @override | 1940 @override |
| 1936 R visitLogicalAnd(Send node, Node left, Node right, A arg) { | 1941 R visitLogicalAnd(Send node, Node left, Node right, A arg) { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 abstract class NewBulkMixin<R, A> | 2194 abstract class NewBulkMixin<R, A> |
| 2190 implements SemanticSendVisitor<R, A>, BulkHandle<R, A> { | 2195 implements SemanticSendVisitor<R, A>, BulkHandle<R, A> { |
| 2191 R bulkHandleNew(NewExpression node, A arg) { | 2196 R bulkHandleNew(NewExpression node, A arg) { |
| 2192 return bulkHandleNode(node, "Constructor invocation `#` unhandled.", arg); | 2197 return bulkHandleNode(node, "Constructor invocation `#` unhandled.", arg); |
| 2193 } | 2198 } |
| 2194 | 2199 |
| 2195 @override | 2200 @override |
| 2196 R visitAbstractClassConstructorInvoke( | 2201 R visitAbstractClassConstructorInvoke( |
| 2197 NewExpression node, | 2202 NewExpression node, |
| 2198 ConstructorElement element, | 2203 ConstructorElement element, |
| 2199 InterfaceType type, | 2204 ResolutionInterfaceType type, |
| 2200 NodeList arguments, | 2205 NodeList arguments, |
| 2201 CallStructure callStructure, | 2206 CallStructure callStructure, |
| 2202 A arg) { | 2207 A arg) { |
| 2203 return bulkHandleNew(node, arg); | 2208 return bulkHandleNew(node, arg); |
| 2204 } | 2209 } |
| 2205 | 2210 |
| 2206 @override | 2211 @override |
| 2207 R visitConstConstructorInvoke( | 2212 R visitConstConstructorInvoke( |
| 2208 NewExpression node, ConstructedConstantExpression constant, A arg) { | 2213 NewExpression node, ConstructedConstantExpression constant, A arg) { |
| 2209 return bulkHandleNew(node, arg); | 2214 return bulkHandleNew(node, arg); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2224 @override | 2229 @override |
| 2225 R visitStringFromEnvironmentConstructorInvoke(NewExpression node, | 2230 R visitStringFromEnvironmentConstructorInvoke(NewExpression node, |
| 2226 StringFromEnvironmentConstantExpression constant, A arg) { | 2231 StringFromEnvironmentConstantExpression constant, A arg) { |
| 2227 return bulkHandleNew(node, arg); | 2232 return bulkHandleNew(node, arg); |
| 2228 } | 2233 } |
| 2229 | 2234 |
| 2230 @override | 2235 @override |
| 2231 R visitConstructorIncompatibleInvoke( | 2236 R visitConstructorIncompatibleInvoke( |
| 2232 NewExpression node, | 2237 NewExpression node, |
| 2233 ConstructorElement constructor, | 2238 ConstructorElement constructor, |
| 2234 InterfaceType type, | 2239 ResolutionInterfaceType type, |
| 2235 NodeList arguments, | 2240 NodeList arguments, |
| 2236 CallStructure callStructure, | 2241 CallStructure callStructure, |
| 2237 A arg) { | 2242 A arg) { |
| 2238 return bulkHandleNew(node, arg); | 2243 return bulkHandleNew(node, arg); |
| 2239 } | 2244 } |
| 2240 | 2245 |
| 2241 @override | 2246 @override |
| 2242 R visitGenerativeConstructorInvoke( | 2247 R visitGenerativeConstructorInvoke( |
| 2243 NewExpression node, | 2248 NewExpression node, |
| 2244 ConstructorElement constructor, | 2249 ConstructorElement constructor, |
| 2245 InterfaceType type, | 2250 ResolutionInterfaceType type, |
| 2246 NodeList arguments, | 2251 NodeList arguments, |
| 2247 CallStructure callStructure, | 2252 CallStructure callStructure, |
| 2248 A arg) { | 2253 A arg) { |
| 2249 return bulkHandleNew(node, arg); | 2254 return bulkHandleNew(node, arg); |
| 2250 } | 2255 } |
| 2251 | 2256 |
| 2252 @override | 2257 @override |
| 2253 R visitRedirectingGenerativeConstructorInvoke( | 2258 R visitRedirectingGenerativeConstructorInvoke( |
| 2254 NewExpression node, | 2259 NewExpression node, |
| 2255 ConstructorElement constructor, | 2260 ConstructorElement constructor, |
| 2256 InterfaceType type, | 2261 ResolutionInterfaceType type, |
| 2257 NodeList arguments, | 2262 NodeList arguments, |
| 2258 CallStructure callStructure, | 2263 CallStructure callStructure, |
| 2259 A arg) { | 2264 A arg) { |
| 2260 return bulkHandleNew(node, arg); | 2265 return bulkHandleNew(node, arg); |
| 2261 } | 2266 } |
| 2262 | 2267 |
| 2263 @override | 2268 @override |
| 2264 R visitFactoryConstructorInvoke( | 2269 R visitFactoryConstructorInvoke( |
| 2265 NewExpression node, | 2270 NewExpression node, |
| 2266 ConstructorElement constructor, | 2271 ConstructorElement constructor, |
| 2267 InterfaceType type, | 2272 ResolutionInterfaceType type, |
| 2268 NodeList arguments, | 2273 NodeList arguments, |
| 2269 CallStructure callStructure, | 2274 CallStructure callStructure, |
| 2270 A arg) { | 2275 A arg) { |
| 2271 return bulkHandleNew(node, arg); | 2276 return bulkHandleNew(node, arg); |
| 2272 } | 2277 } |
| 2273 | 2278 |
| 2274 @override | 2279 @override |
| 2275 R visitRedirectingFactoryConstructorInvoke( | 2280 R visitRedirectingFactoryConstructorInvoke( |
| 2276 NewExpression node, | 2281 NewExpression node, |
| 2277 ConstructorElement constructor, | 2282 ConstructorElement constructor, |
| 2278 InterfaceType type, | 2283 ResolutionInterfaceType type, |
| 2279 ConstructorElement effectiveTarget, | 2284 ConstructorElement effectiveTarget, |
| 2280 InterfaceType effectiveTargetType, | 2285 ResolutionInterfaceType effectiveTargetType, |
| 2281 NodeList arguments, | 2286 NodeList arguments, |
| 2282 CallStructure callStructure, | 2287 CallStructure callStructure, |
| 2283 A arg) { | 2288 A arg) { |
| 2284 return bulkHandleNew(node, arg); | 2289 return bulkHandleNew(node, arg); |
| 2285 } | 2290 } |
| 2286 | 2291 |
| 2287 @override | 2292 @override |
| 2288 R visitUnresolvedClassConstructorInvoke(NewExpression node, Element element, | 2293 R visitUnresolvedClassConstructorInvoke(NewExpression node, Element element, |
| 2289 DartType type, NodeList arguments, Selector selector, A arg) { | 2294 ResolutionDartType type, NodeList arguments, Selector selector, A arg) { |
| 2290 return bulkHandleNew(node, arg); | 2295 return bulkHandleNew(node, arg); |
| 2291 } | 2296 } |
| 2292 | 2297 |
| 2293 @override | 2298 @override |
| 2294 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, | 2299 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, |
| 2295 DartType type, NodeList arguments, Selector selector, A arg) { | 2300 ResolutionDartType type, NodeList arguments, Selector selector, A arg) { |
| 2296 return bulkHandleNew(node, arg); | 2301 return bulkHandleNew(node, arg); |
| 2297 } | 2302 } |
| 2298 | 2303 |
| 2299 @override | 2304 @override |
| 2300 R visitUnresolvedRedirectingFactoryConstructorInvoke( | 2305 R visitUnresolvedRedirectingFactoryConstructorInvoke( |
| 2301 NewExpression node, | 2306 NewExpression node, |
| 2302 ConstructorElement constructor, | 2307 ConstructorElement constructor, |
| 2303 InterfaceType type, | 2308 ResolutionInterfaceType type, |
| 2304 NodeList arguments, | 2309 NodeList arguments, |
| 2305 CallStructure callStructure, | 2310 CallStructure callStructure, |
| 2306 A arg) { | 2311 A arg) { |
| 2307 return bulkHandleNew(node, arg); | 2312 return bulkHandleNew(node, arg); |
| 2308 } | 2313 } |
| 2309 } | 2314 } |
| 2310 | 2315 |
| 2311 /// Visitor that implements [SemanticSendVisitor] by the use of `BulkX` mixins. | 2316 /// Visitor that implements [SemanticSendVisitor] by the use of `BulkX` mixins. |
| 2312 /// | 2317 /// |
| 2313 /// This class is useful in itself, but shows how to use the `BulkX` mixins and | 2318 /// This class is useful in itself, but shows how to use the `BulkX` mixins and |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2427 Node body, | 2432 Node body, |
| 2428 A arg) { | 2433 A arg) { |
| 2429 return bulkHandleConstructorDeclaration(node, arg); | 2434 return bulkHandleConstructorDeclaration(node, arg); |
| 2430 } | 2435 } |
| 2431 | 2436 |
| 2432 @override | 2437 @override |
| 2433 R visitRedirectingFactoryConstructorDeclaration( | 2438 R visitRedirectingFactoryConstructorDeclaration( |
| 2434 FunctionExpression node, | 2439 FunctionExpression node, |
| 2435 ConstructorElement constructor, | 2440 ConstructorElement constructor, |
| 2436 NodeList parameters, | 2441 NodeList parameters, |
| 2437 InterfaceType redirectionType, | 2442 ResolutionInterfaceType redirectionType, |
| 2438 ConstructorElement redirectionTarget, | 2443 ConstructorElement redirectionTarget, |
| 2439 A arg) { | 2444 A arg) { |
| 2440 return bulkHandleConstructorDeclaration(node, arg); | 2445 return bulkHandleConstructorDeclaration(node, arg); |
| 2441 } | 2446 } |
| 2442 | 2447 |
| 2443 @override | 2448 @override |
| 2444 R visitRedirectingGenerativeConstructorDeclaration( | 2449 R visitRedirectingGenerativeConstructorDeclaration( |
| 2445 FunctionExpression node, | 2450 FunctionExpression node, |
| 2446 ConstructorElement constructor, | 2451 ConstructorElement constructor, |
| 2447 NodeList parameters, | 2452 NodeList parameters, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 @override | 2487 @override |
| 2483 R visitFieldInitializer( | 2488 R visitFieldInitializer( |
| 2484 SendSet node, FieldElement field, Node initializer, A arg) { | 2489 SendSet node, FieldElement field, Node initializer, A arg) { |
| 2485 return bulkHandleInitializer(node, arg); | 2490 return bulkHandleInitializer(node, arg); |
| 2486 } | 2491 } |
| 2487 | 2492 |
| 2488 @override | 2493 @override |
| 2489 R visitSuperConstructorInvoke( | 2494 R visitSuperConstructorInvoke( |
| 2490 Send node, | 2495 Send node, |
| 2491 ConstructorElement superConstructor, | 2496 ConstructorElement superConstructor, |
| 2492 InterfaceType type, | 2497 ResolutionInterfaceType type, |
| 2493 NodeList arguments, | 2498 NodeList arguments, |
| 2494 CallStructure callStructure, | 2499 CallStructure callStructure, |
| 2495 A arg) { | 2500 A arg) { |
| 2496 return bulkHandleInitializer(node, arg); | 2501 return bulkHandleInitializer(node, arg); |
| 2497 } | 2502 } |
| 2498 | 2503 |
| 2499 @override | 2504 @override |
| 2500 R visitImplicitSuperConstructorInvoke(FunctionExpression node, | 2505 R visitImplicitSuperConstructorInvoke( |
| 2501 ConstructorElement superConstructor, InterfaceType type, A arg) { | 2506 FunctionExpression node, |
| 2507 ConstructorElement superConstructor, |
| 2508 ResolutionInterfaceType type, |
| 2509 A arg) { |
| 2502 return bulkHandleInitializer(node, arg); | 2510 return bulkHandleInitializer(node, arg); |
| 2503 } | 2511 } |
| 2504 | 2512 |
| 2505 @override | 2513 @override |
| 2506 R visitThisConstructorInvoke(Send node, ConstructorElement thisConstructor, | 2514 R visitThisConstructorInvoke(Send node, ConstructorElement thisConstructor, |
| 2507 NodeList arguments, CallStructure callStructure, A arg) { | 2515 NodeList arguments, CallStructure callStructure, A arg) { |
| 2508 return bulkHandleInitializer(node, arg); | 2516 return bulkHandleInitializer(node, arg); |
| 2509 } | 2517 } |
| 2510 } | 2518 } |
| 2511 | 2519 |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3012 } | 3020 } |
| 3013 | 3021 |
| 3014 @override | 3022 @override |
| 3015 R visitUnresolvedSuperInvoke(Send node, Element function, NodeList arguments, | 3023 R visitUnresolvedSuperInvoke(Send node, Element function, NodeList arguments, |
| 3016 Selector selector, A arg) { | 3024 Selector selector, A arg) { |
| 3017 apply(arguments, arg); | 3025 apply(arguments, arg); |
| 3018 return null; | 3026 return null; |
| 3019 } | 3027 } |
| 3020 | 3028 |
| 3021 @override | 3029 @override |
| 3022 R visitAs(Send node, Node expression, DartType type, A arg) { | 3030 R visitAs(Send node, Node expression, ResolutionDartType type, A arg) { |
| 3023 apply(expression, arg); | 3031 apply(expression, arg); |
| 3024 return null; | 3032 return null; |
| 3025 } | 3033 } |
| 3026 | 3034 |
| 3027 @override | 3035 @override |
| 3028 R visitBinary( | 3036 R visitBinary( |
| 3029 Send node, Node left, BinaryOperator operator, Node right, A arg) { | 3037 Send node, Node left, BinaryOperator operator, Node right, A arg) { |
| 3030 apply(left, arg); | 3038 apply(left, arg); |
| 3031 apply(right, arg); | 3039 apply(right, arg); |
| 3032 return null; | 3040 return null; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3228 | 3236 |
| 3229 @override | 3237 @override |
| 3230 R visitIndexSet(SendSet node, Node receiver, Node index, Node rhs, A arg) { | 3238 R visitIndexSet(SendSet node, Node receiver, Node index, Node rhs, A arg) { |
| 3231 apply(receiver, arg); | 3239 apply(receiver, arg); |
| 3232 apply(index, arg); | 3240 apply(index, arg); |
| 3233 apply(rhs, arg); | 3241 apply(rhs, arg); |
| 3234 return null; | 3242 return null; |
| 3235 } | 3243 } |
| 3236 | 3244 |
| 3237 @override | 3245 @override |
| 3238 R visitIs(Send node, Node expression, DartType type, A arg) { | 3246 R visitIs(Send node, Node expression, ResolutionDartType type, A arg) { |
| 3239 apply(expression, arg); | 3247 apply(expression, arg); |
| 3240 return null; | 3248 return null; |
| 3241 } | 3249 } |
| 3242 | 3250 |
| 3243 @override | 3251 @override |
| 3244 R visitIsNot(Send node, Node expression, DartType type, A arg) { | 3252 R visitIsNot(Send node, Node expression, ResolutionDartType type, A arg) { |
| 3245 apply(expression, arg); | 3253 apply(expression, arg); |
| 3246 return null; | 3254 return null; |
| 3247 } | 3255 } |
| 3248 | 3256 |
| 3249 @override | 3257 @override |
| 3250 R visitLocalFunctionGet(Send node, LocalFunctionElement function, A arg) { | 3258 R visitLocalFunctionGet(Send node, LocalFunctionElement function, A arg) { |
| 3251 return null; | 3259 return null; |
| 3252 } | 3260 } |
| 3253 | 3261 |
| 3254 @override | 3262 @override |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4420 @override | 4428 @override |
| 4421 R visitStringFromEnvironmentConstructorInvoke(NewExpression node, | 4429 R visitStringFromEnvironmentConstructorInvoke(NewExpression node, |
| 4422 StringFromEnvironmentConstantExpression constant, A arg) { | 4430 StringFromEnvironmentConstantExpression constant, A arg) { |
| 4423 return null; | 4431 return null; |
| 4424 } | 4432 } |
| 4425 | 4433 |
| 4426 @override | 4434 @override |
| 4427 R visitConstructorIncompatibleInvoke( | 4435 R visitConstructorIncompatibleInvoke( |
| 4428 NewExpression node, | 4436 NewExpression node, |
| 4429 ConstructorElement constructor, | 4437 ConstructorElement constructor, |
| 4430 InterfaceType type, | 4438 ResolutionInterfaceType type, |
| 4431 NodeList arguments, | 4439 NodeList arguments, |
| 4432 CallStructure callStructure, | 4440 CallStructure callStructure, |
| 4433 A arg) { | 4441 A arg) { |
| 4434 apply(arguments, arg); | 4442 apply(arguments, arg); |
| 4435 return null; | 4443 return null; |
| 4436 } | 4444 } |
| 4437 | 4445 |
| 4438 @override | 4446 @override |
| 4439 R visitUnresolvedClassConstructorInvoke( | 4447 R visitUnresolvedClassConstructorInvoke( |
| 4440 NewExpression node, | 4448 NewExpression node, |
| 4441 Element constructor, | 4449 Element constructor, |
| 4442 DartType type, | 4450 ResolutionDartType type, |
| 4443 NodeList arguments, | 4451 NodeList arguments, |
| 4444 Selector selector, | 4452 Selector selector, |
| 4445 A arg) { | 4453 A arg) { |
| 4446 apply(arguments, arg); | 4454 apply(arguments, arg); |
| 4447 return null; | 4455 return null; |
| 4448 } | 4456 } |
| 4449 | 4457 |
| 4450 @override | 4458 @override |
| 4451 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, | 4459 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, |
| 4452 DartType type, NodeList arguments, Selector selector, A arg) { | 4460 ResolutionDartType type, NodeList arguments, Selector selector, A arg) { |
| 4453 apply(arguments, arg); | 4461 apply(arguments, arg); |
| 4454 return null; | 4462 return null; |
| 4455 } | 4463 } |
| 4456 | 4464 |
| 4457 @override | 4465 @override |
| 4458 R visitFactoryConstructorInvoke( | 4466 R visitFactoryConstructorInvoke( |
| 4459 NewExpression node, | 4467 NewExpression node, |
| 4460 ConstructorElement constructor, | 4468 ConstructorElement constructor, |
| 4461 InterfaceType type, | 4469 ResolutionInterfaceType type, |
| 4462 NodeList arguments, | 4470 NodeList arguments, |
| 4463 CallStructure callStructure, | 4471 CallStructure callStructure, |
| 4464 A arg) { | 4472 A arg) { |
| 4465 apply(arguments, arg); | 4473 apply(arguments, arg); |
| 4466 return null; | 4474 return null; |
| 4467 } | 4475 } |
| 4468 | 4476 |
| 4469 @override | 4477 @override |
| 4470 R visitGenerativeConstructorInvoke( | 4478 R visitGenerativeConstructorInvoke( |
| 4471 NewExpression node, | 4479 NewExpression node, |
| 4472 ConstructorElement constructor, | 4480 ConstructorElement constructor, |
| 4473 InterfaceType type, | 4481 ResolutionInterfaceType type, |
| 4474 NodeList arguments, | 4482 NodeList arguments, |
| 4475 CallStructure callStructure, | 4483 CallStructure callStructure, |
| 4476 A arg) { | 4484 A arg) { |
| 4477 apply(arguments, arg); | 4485 apply(arguments, arg); |
| 4478 return null; | 4486 return null; |
| 4479 } | 4487 } |
| 4480 | 4488 |
| 4481 @override | 4489 @override |
| 4482 R visitRedirectingFactoryConstructorInvoke( | 4490 R visitRedirectingFactoryConstructorInvoke( |
| 4483 NewExpression node, | 4491 NewExpression node, |
| 4484 ConstructorElement constructor, | 4492 ConstructorElement constructor, |
| 4485 InterfaceType type, | 4493 ResolutionInterfaceType type, |
| 4486 ConstructorElement effectiveTarget, | 4494 ConstructorElement effectiveTarget, |
| 4487 InterfaceType effectiveTargetType, | 4495 ResolutionInterfaceType effectiveTargetType, |
| 4488 NodeList arguments, | 4496 NodeList arguments, |
| 4489 CallStructure callStructure, | 4497 CallStructure callStructure, |
| 4490 A arg) { | 4498 A arg) { |
| 4491 apply(arguments, arg); | 4499 apply(arguments, arg); |
| 4492 return null; | 4500 return null; |
| 4493 } | 4501 } |
| 4494 | 4502 |
| 4495 @override | 4503 @override |
| 4496 R visitRedirectingGenerativeConstructorInvoke( | 4504 R visitRedirectingGenerativeConstructorInvoke( |
| 4497 NewExpression node, | 4505 NewExpression node, |
| 4498 ConstructorElement constructor, | 4506 ConstructorElement constructor, |
| 4499 InterfaceType type, | 4507 ResolutionInterfaceType type, |
| 4500 NodeList arguments, | 4508 NodeList arguments, |
| 4501 CallStructure callStructure, | 4509 CallStructure callStructure, |
| 4502 A arg) { | 4510 A arg) { |
| 4503 apply(arguments, arg); | 4511 apply(arguments, arg); |
| 4504 return null; | 4512 return null; |
| 4505 } | 4513 } |
| 4506 | 4514 |
| 4507 @override | 4515 @override |
| 4508 R visitAbstractClassConstructorInvoke( | 4516 R visitAbstractClassConstructorInvoke( |
| 4509 NewExpression node, | 4517 NewExpression node, |
| 4510 ConstructorElement element, | 4518 ConstructorElement element, |
| 4511 InterfaceType type, | 4519 ResolutionInterfaceType type, |
| 4512 NodeList arguments, | 4520 NodeList arguments, |
| 4513 CallStructure callStructure, | 4521 CallStructure callStructure, |
| 4514 A arg) { | 4522 A arg) { |
| 4515 apply(arguments, arg); | 4523 apply(arguments, arg); |
| 4516 return null; | 4524 return null; |
| 4517 } | 4525 } |
| 4518 | 4526 |
| 4519 @override | 4527 @override |
| 4520 R visitUnresolvedRedirectingFactoryConstructorInvoke( | 4528 R visitUnresolvedRedirectingFactoryConstructorInvoke( |
| 4521 NewExpression node, | 4529 NewExpression node, |
| 4522 ConstructorElement constructor, | 4530 ConstructorElement constructor, |
| 4523 InterfaceType type, | 4531 ResolutionInterfaceType type, |
| 4524 NodeList arguments, | 4532 NodeList arguments, |
| 4525 CallStructure callStructure, | 4533 CallStructure callStructure, |
| 4526 A arg) { | 4534 A arg) { |
| 4527 apply(arguments, arg); | 4535 apply(arguments, arg); |
| 4528 return null; | 4536 return null; |
| 4529 } | 4537 } |
| 4530 | 4538 |
| 4531 @override | 4539 @override |
| 4532 R errorNonConstantConstructorInvoke(NewExpression node, Element element, | 4540 R errorNonConstantConstructorInvoke( |
| 4533 DartType type, NodeList arguments, CallStructure callStructure, A arg) { | 4541 NewExpression node, |
| 4542 Element element, |
| 4543 ResolutionDartType type, |
| 4544 NodeList arguments, |
| 4545 CallStructure callStructure, |
| 4546 A arg) { |
| 4534 apply(arguments, arg); | 4547 apply(arguments, arg); |
| 4535 return null; | 4548 return null; |
| 4536 } | 4549 } |
| 4537 | 4550 |
| 4538 @override | 4551 @override |
| 4539 R visitUnresolvedStaticGetterCompound(Send node, Element element, | 4552 R visitUnresolvedStaticGetterCompound(Send node, Element element, |
| 4540 MethodElement setter, AssignmentOperator operator, Node rhs, A arg) { | 4553 MethodElement setter, AssignmentOperator operator, Node rhs, A arg) { |
| 4541 apply(rhs, arg); | 4554 apply(rhs, arg); |
| 4542 return null; | 4555 return null; |
| 4543 } | 4556 } |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4927 applyParameters(parameters, arg); | 4940 applyParameters(parameters, arg); |
| 4928 apply(body, arg); | 4941 apply(body, arg); |
| 4929 return null; | 4942 return null; |
| 4930 } | 4943 } |
| 4931 | 4944 |
| 4932 @override | 4945 @override |
| 4933 R visitRedirectingFactoryConstructorDeclaration( | 4946 R visitRedirectingFactoryConstructorDeclaration( |
| 4934 FunctionExpression node, | 4947 FunctionExpression node, |
| 4935 ConstructorElement constructor, | 4948 ConstructorElement constructor, |
| 4936 NodeList parameters, | 4949 NodeList parameters, |
| 4937 InterfaceType redirectionType, | 4950 ResolutionInterfaceType redirectionType, |
| 4938 ConstructorElement redirectionTarget, | 4951 ConstructorElement redirectionTarget, |
| 4939 A arg) { | 4952 A arg) { |
| 4940 applyParameters(parameters, arg); | 4953 applyParameters(parameters, arg); |
| 4941 return null; | 4954 return null; |
| 4942 } | 4955 } |
| 4943 | 4956 |
| 4944 @override | 4957 @override |
| 4945 R visitRedirectingGenerativeConstructorDeclaration( | 4958 R visitRedirectingGenerativeConstructorDeclaration( |
| 4946 FunctionExpression node, | 4959 FunctionExpression node, |
| 4947 ConstructorElement constructor, | 4960 ConstructorElement constructor, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4958 MethodElement function, NodeList parameters, Node body, A arg) { | 4971 MethodElement function, NodeList parameters, Node body, A arg) { |
| 4959 applyParameters(parameters, arg); | 4972 applyParameters(parameters, arg); |
| 4960 apply(body, arg); | 4973 apply(body, arg); |
| 4961 return null; | 4974 return null; |
| 4962 } | 4975 } |
| 4963 | 4976 |
| 4964 @override | 4977 @override |
| 4965 R visitSuperConstructorInvoke( | 4978 R visitSuperConstructorInvoke( |
| 4966 Send node, | 4979 Send node, |
| 4967 ConstructorElement superConstructor, | 4980 ConstructorElement superConstructor, |
| 4968 InterfaceType type, | 4981 ResolutionInterfaceType type, |
| 4969 NodeList arguments, | 4982 NodeList arguments, |
| 4970 CallStructure callStructure, | 4983 CallStructure callStructure, |
| 4971 A arg) { | 4984 A arg) { |
| 4972 apply(arguments, arg); | 4985 apply(arguments, arg); |
| 4973 return null; | 4986 return null; |
| 4974 } | 4987 } |
| 4975 | 4988 |
| 4976 @override | 4989 @override |
| 4977 R visitImplicitSuperConstructorInvoke(FunctionExpression node, | 4990 R visitImplicitSuperConstructorInvoke( |
| 4978 ConstructorElement superConstructor, InterfaceType type, A arg) { | 4991 FunctionExpression node, |
| 4992 ConstructorElement superConstructor, |
| 4993 ResolutionInterfaceType type, |
| 4994 A arg) { |
| 4979 return null; | 4995 return null; |
| 4980 } | 4996 } |
| 4981 | 4997 |
| 4982 @override | 4998 @override |
| 4983 R visitThisConstructorInvoke(Send node, ConstructorElement thisConstructor, | 4999 R visitThisConstructorInvoke(Send node, ConstructorElement thisConstructor, |
| 4984 NodeList arguments, CallStructure callStructure, A arg) { | 5000 NodeList arguments, CallStructure callStructure, A arg) { |
| 4985 apply(arguments, arg); | 5001 apply(arguments, arg); |
| 4986 return null; | 5002 return null; |
| 4987 } | 5003 } |
| 4988 | 5004 |
| (...skipping 3221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8210 } | 8226 } |
| 8211 } | 8227 } |
| 8212 | 8228 |
| 8213 /// Mixin that groups the non-constant `visitXConstructorInvoke` methods by | 8229 /// Mixin that groups the non-constant `visitXConstructorInvoke` methods by |
| 8214 /// delegating calls to the `handleConstructorInvoke` method. | 8230 /// delegating calls to the `handleConstructorInvoke` method. |
| 8215 /// | 8231 /// |
| 8216 /// This mixin is useful for the cases where all constructor invocations are | 8232 /// This mixin is useful for the cases where all constructor invocations are |
| 8217 /// handled uniformly. | 8233 /// handled uniformly. |
| 8218 abstract class BaseImplementationOfNewMixin<R, A> | 8234 abstract class BaseImplementationOfNewMixin<R, A> |
| 8219 implements SemanticSendVisitor<R, A> { | 8235 implements SemanticSendVisitor<R, A> { |
| 8220 R handleConstructorInvoke(NewExpression node, ConstructorElement constructor, | 8236 R handleConstructorInvoke( |
| 8221 DartType type, NodeList arguments, CallStructure callStructure, A arg); | 8237 NewExpression node, |
| 8238 ConstructorElement constructor, |
| 8239 ResolutionDartType type, |
| 8240 NodeList arguments, |
| 8241 CallStructure callStructure, |
| 8242 A arg); |
| 8222 | 8243 |
| 8223 R visitGenerativeConstructorInvoke( | 8244 R visitGenerativeConstructorInvoke( |
| 8224 NewExpression node, | 8245 NewExpression node, |
| 8225 ConstructorElement constructor, | 8246 ConstructorElement constructor, |
| 8226 InterfaceType type, | 8247 ResolutionInterfaceType type, |
| 8227 NodeList arguments, | 8248 NodeList arguments, |
| 8228 CallStructure callStructure, | 8249 CallStructure callStructure, |
| 8229 A arg) { | 8250 A arg) { |
| 8230 return handleConstructorInvoke( | 8251 return handleConstructorInvoke( |
| 8231 node, constructor, type, arguments, callStructure, arg); | 8252 node, constructor, type, arguments, callStructure, arg); |
| 8232 } | 8253 } |
| 8233 | 8254 |
| 8234 @override | 8255 @override |
| 8235 R visitRedirectingGenerativeConstructorInvoke( | 8256 R visitRedirectingGenerativeConstructorInvoke( |
| 8236 NewExpression node, | 8257 NewExpression node, |
| 8237 ConstructorElement constructor, | 8258 ConstructorElement constructor, |
| 8238 InterfaceType type, | 8259 ResolutionInterfaceType type, |
| 8239 NodeList arguments, | 8260 NodeList arguments, |
| 8240 CallStructure callStructure, | 8261 CallStructure callStructure, |
| 8241 A arg) { | 8262 A arg) { |
| 8242 return handleConstructorInvoke( | 8263 return handleConstructorInvoke( |
| 8243 node, constructor, type, arguments, callStructure, arg); | 8264 node, constructor, type, arguments, callStructure, arg); |
| 8244 } | 8265 } |
| 8245 | 8266 |
| 8246 @override | 8267 @override |
| 8247 R visitFactoryConstructorInvoke( | 8268 R visitFactoryConstructorInvoke( |
| 8248 NewExpression node, | 8269 NewExpression node, |
| 8249 ConstructorElement constructor, | 8270 ConstructorElement constructor, |
| 8250 InterfaceType type, | 8271 ResolutionInterfaceType type, |
| 8251 NodeList arguments, | 8272 NodeList arguments, |
| 8252 CallStructure callStructure, | 8273 CallStructure callStructure, |
| 8253 A arg) { | 8274 A arg) { |
| 8254 return handleConstructorInvoke( | 8275 return handleConstructorInvoke( |
| 8255 node, constructor, type, arguments, callStructure, arg); | 8276 node, constructor, type, arguments, callStructure, arg); |
| 8256 } | 8277 } |
| 8257 | 8278 |
| 8258 @override | 8279 @override |
| 8259 R visitRedirectingFactoryConstructorInvoke( | 8280 R visitRedirectingFactoryConstructorInvoke( |
| 8260 NewExpression node, | 8281 NewExpression node, |
| 8261 ConstructorElement constructor, | 8282 ConstructorElement constructor, |
| 8262 InterfaceType type, | 8283 ResolutionInterfaceType type, |
| 8263 ConstructorElement effectiveTarget, | 8284 ConstructorElement effectiveTarget, |
| 8264 InterfaceType effectiveTargetType, | 8285 ResolutionInterfaceType effectiveTargetType, |
| 8265 NodeList arguments, | 8286 NodeList arguments, |
| 8266 CallStructure callStructure, | 8287 CallStructure callStructure, |
| 8267 A arg) { | 8288 A arg) { |
| 8268 return handleConstructorInvoke( | 8289 return handleConstructorInvoke( |
| 8269 node, constructor, type, arguments, callStructure, arg); | 8290 node, constructor, type, arguments, callStructure, arg); |
| 8270 } | 8291 } |
| 8271 | 8292 |
| 8272 @override | 8293 @override |
| 8273 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, | 8294 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, |
| 8274 DartType type, NodeList arguments, Selector selector, A arg) { | 8295 ResolutionDartType type, NodeList arguments, Selector selector, A arg) { |
| 8275 return handleConstructorInvoke( | 8296 return handleConstructorInvoke( |
| 8276 node, constructor, type, arguments, selector.callStructure, arg); | 8297 node, constructor, type, arguments, selector.callStructure, arg); |
| 8277 } | 8298 } |
| 8278 | 8299 |
| 8279 @override | 8300 @override |
| 8280 R visitUnresolvedClassConstructorInvoke(NewExpression node, Element element, | 8301 R visitUnresolvedClassConstructorInvoke(NewExpression node, Element element, |
| 8281 DartType type, NodeList arguments, Selector selector, A arg) { | 8302 ResolutionDartType type, NodeList arguments, Selector selector, A arg) { |
| 8282 return handleConstructorInvoke( | 8303 return handleConstructorInvoke( |
| 8283 node, element, type, arguments, selector.callStructure, arg); | 8304 node, element, type, arguments, selector.callStructure, arg); |
| 8284 } | 8305 } |
| 8285 | 8306 |
| 8286 @override | 8307 @override |
| 8287 R visitAbstractClassConstructorInvoke( | 8308 R visitAbstractClassConstructorInvoke( |
| 8288 NewExpression node, | 8309 NewExpression node, |
| 8289 ConstructorElement constructor, | 8310 ConstructorElement constructor, |
| 8290 InterfaceType type, | 8311 ResolutionInterfaceType type, |
| 8291 NodeList arguments, | 8312 NodeList arguments, |
| 8292 CallStructure callStructure, | 8313 CallStructure callStructure, |
| 8293 A arg) { | 8314 A arg) { |
| 8294 return handleConstructorInvoke( | 8315 return handleConstructorInvoke( |
| 8295 node, constructor, type, arguments, callStructure, arg); | 8316 node, constructor, type, arguments, callStructure, arg); |
| 8296 } | 8317 } |
| 8297 | 8318 |
| 8298 @override | 8319 @override |
| 8299 R visitUnresolvedRedirectingFactoryConstructorInvoke( | 8320 R visitUnresolvedRedirectingFactoryConstructorInvoke( |
| 8300 NewExpression node, | 8321 NewExpression node, |
| 8301 ConstructorElement constructor, | 8322 ConstructorElement constructor, |
| 8302 InterfaceType type, | 8323 ResolutionInterfaceType type, |
| 8303 NodeList arguments, | 8324 NodeList arguments, |
| 8304 CallStructure callStructure, | 8325 CallStructure callStructure, |
| 8305 A arg) { | 8326 A arg) { |
| 8306 return handleConstructorInvoke( | 8327 return handleConstructorInvoke( |
| 8307 node, constructor, type, arguments, callStructure, arg); | 8328 node, constructor, type, arguments, callStructure, arg); |
| 8308 } | 8329 } |
| 8309 } | 8330 } |
| OLD | NEW |