OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.resolution.members; | 5 library dart2js.resolution.members; |
6 | 6 |
7 import '../common/names.dart' show | 7 import '../common/names.dart' show |
8 Selectors; | 8 Selectors; |
9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
10 Compiler, | 10 Compiler, |
(...skipping 3441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 | 3452 |
3453 // TODO(23998): Remove these when selectors are only accessed | 3453 // TODO(23998): Remove these when selectors are only accessed |
3454 // through the send structure. | 3454 // through the send structure. |
3455 registry.setGetterSelectorInComplexSendSet(node, getterSelector); | 3455 registry.setGetterSelectorInComplexSendSet(node, getterSelector); |
3456 registry.setSelector(node, setterSelector); | 3456 registry.setSelector(node, setterSelector); |
3457 registry.setOperatorSelectorInComplexSendSet(node, operatorSelector); | 3457 registry.setOperatorSelectorInComplexSendSet(node, operatorSelector); |
3458 | 3458 |
3459 registry.registerDynamicInvocation( | 3459 registry.registerDynamicInvocation( |
3460 new UniverseSelector(operatorSelector, null)); | 3460 new UniverseSelector(operatorSelector, null)); |
3461 | 3461 |
3462 SendStructure sendStructure = | 3462 SendStructure sendStructure; |
3463 new CompoundStructure(semantics, operator); | 3463 if (operator.kind == AssignmentOperatorKind.IF_NULL) { |
| 3464 sendStructure = new SetIfNullStructure(semantics); |
| 3465 } else { |
| 3466 sendStructure = new CompoundStructure(semantics, operator); |
| 3467 } |
3464 registry.registerSendStructure(node, sendStructure); | 3468 registry.registerSendStructure(node, sendStructure); |
3465 } | 3469 } |
3466 } | 3470 } |
3467 return new ResolutionResult.forElement(semantics.setter); | 3471 return new ResolutionResult.forElement(semantics.setter); |
3468 } | 3472 } |
3469 | 3473 |
3470 ResolutionResult visitSendSet(SendSet node) { | 3474 ResolutionResult visitSendSet(SendSet node) { |
3471 if (node.isIndex) { | 3475 if (node.isIndex) { |
3472 // `a[b] = c` | 3476 // `a[b] = c` |
3473 if (node.isSuperCall) { | 3477 if (node.isSuperCall) { |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4641 } | 4645 } |
4642 return const NoneResult(); | 4646 return const NoneResult(); |
4643 } | 4647 } |
4644 } | 4648 } |
4645 | 4649 |
4646 /// Looks up [name] in [scope] and unwraps the result. | 4650 /// Looks up [name] in [scope] and unwraps the result. |
4647 Element lookupInScope(Compiler compiler, Node node, | 4651 Element lookupInScope(Compiler compiler, Node node, |
4648 Scope scope, String name) { | 4652 Scope scope, String name) { |
4649 return Elements.unwrap(scope.lookup(name), compiler, node); | 4653 return Elements.unwrap(scope.lookup(name), compiler, node); |
4650 } | 4654 } |
OLD | NEW |