| 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.send_structure; | 5 library dart2js.send_structure; |
| 6 | 6 |
| 7 import 'access_semantics.dart'; | 7 import 'access_semantics.dart'; |
| 8 import 'operators.dart'; | 8 import 'operators.dart'; |
| 9 import 'semantic_visitor.dart'; | 9 import 'semantic_visitor.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2297 arg); | 2297 arg); |
| 2298 } | 2298 } |
| 2299 } | 2299 } |
| 2300 throw new SpannableAssertionFailure(node, | 2300 throw new SpannableAssertionFailure(node, |
| 2301 "Invalid compound assigment: ${semantics}"); | 2301 "Invalid compound assigment: ${semantics}"); |
| 2302 } | 2302 } |
| 2303 | 2303 |
| 2304 String toString() => 'postfix($operator,$semantics)'; | 2304 String toString() => 'postfix($operator,$semantics)'; |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 |
| 2308 /// The structure for a [Send] whose prefix is a prefix for a deferred library. |
| 2309 /// For instance `deferred.a` where `deferred` is a deferred prefix. |
| 2310 class DeferredPrefixStructure<R, A> implements SendStructure<R, A> { |
| 2311 /// The deferred prefix element. |
| 2312 final PrefixElement prefix; |
| 2313 |
| 2314 /// The send structure for the whole [Send] node. For instance a |
| 2315 /// [GetStructure] for `deferred.a` where `a` is a top level member of the |
| 2316 /// deferred library. |
| 2317 final SendStructure sendStructure; |
| 2318 |
| 2319 DeferredPrefixStructure(this.prefix, this.sendStructure) { |
| 2320 assert(sendStructure != null); |
| 2321 } |
| 2322 |
| 2323 @override |
| 2324 R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg) { |
| 2325 visitor.previsitDeferredAccess(send, prefix, arg); |
| 2326 return sendStructure.dispatch(visitor, send, arg); |
| 2327 } |
| 2328 } |
| 2329 |
| 2330 |
| 2307 /// The structure for a [NewExpression] of a new invocation. | 2331 /// The structure for a [NewExpression] of a new invocation. |
| 2308 abstract class NewStructure<R, A> implements SemanticSendStructure<R, A> { | 2332 abstract class NewStructure<R, A> implements SemanticSendStructure<R, A> { |
| 2309 /// Calls the matching visit method on [visitor] with [node] and [arg]. | 2333 /// Calls the matching visit method on [visitor] with [node] and [arg]. |
| 2310 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg); | 2334 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg); |
| 2311 } | 2335 } |
| 2312 | 2336 |
| 2313 /// The structure for a [NewExpression] of a new invocation. For instance | 2337 /// The structure for a [NewExpression] of a new invocation. For instance |
| 2314 /// `new C()`. | 2338 /// `new C()`. |
| 2315 class NewInvokeStructure<R, A> extends NewStructure<R, A> { | 2339 class NewInvokeStructure<R, A> extends NewStructure<R, A> { |
| 2316 final ConstructorAccessSemantics semantics; | 2340 final ConstructorAccessSemantics semantics; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 ThisConstructorInvokeStructure( | 2654 ThisConstructorInvokeStructure( |
| 2631 this.node, this.constructor, this.callStructure); | 2655 this.node, this.constructor, this.callStructure); |
| 2632 | 2656 |
| 2633 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { | 2657 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { |
| 2634 return visitor.visitThisConstructorInvoke( | 2658 return visitor.visitThisConstructorInvoke( |
| 2635 node, constructor, node.argumentsNode, callStructure, arg); | 2659 node, constructor, node.argumentsNode, callStructure, arg); |
| 2636 } | 2660 } |
| 2637 | 2661 |
| 2638 bool get isConstructorInvoke => true; | 2662 bool get isConstructorInvoke => true; |
| 2639 } | 2663 } |
| OLD | NEW |