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.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart' show | 8 import '../common/names.dart' show |
9 Selectors; | 9 Selectors; |
10 import '../common/resolution.dart' show | 10 import '../common/resolution.dart' show |
(...skipping 3196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3207 registry.setSelector(node, setterSelector); | 3207 registry.setSelector(node, setterSelector); |
3208 registry.setOperatorSelectorInComplexSendSet(node, operatorSelector); | 3208 registry.setOperatorSelectorInComplexSendSet(node, operatorSelector); |
3209 | 3209 |
3210 registry.registerDynamicUse( | 3210 registry.registerDynamicUse( |
3211 new DynamicUse(getterSelector, null)); | 3211 new DynamicUse(getterSelector, null)); |
3212 registry.registerDynamicUse( | 3212 registry.registerDynamicUse( |
3213 new DynamicUse(setterSelector, null)); | 3213 new DynamicUse(setterSelector, null)); |
3214 registry.registerDynamicUse( | 3214 registry.registerDynamicUse( |
3215 new DynamicUse(operatorSelector, null)); | 3215 new DynamicUse(operatorSelector, null)); |
3216 | 3216 |
3217 SendStructure sendStructure = | 3217 SendStructure sendStructure; |
3218 new CompoundIndexSetStructure(semantics, operator); | 3218 if (operator.kind == AssignmentOperatorKind.IF_NULL) { |
| 3219 sendStructure = new IndexSetIfNullStructure(semantics); |
| 3220 } else { |
| 3221 sendStructure = new CompoundIndexSetStructure(semantics, operator); |
| 3222 } |
3219 registry.registerSendStructure(node, sendStructure); | 3223 registry.registerSendStructure(node, sendStructure); |
3220 return const NoneResult(); | 3224 return const NoneResult(); |
3221 } | 3225 } |
3222 } | 3226 } |
3223 } | 3227 } |
3224 | 3228 |
3225 /// Handle super index operations like `super[a] = b`, `super[a] += b`, and | 3229 /// Handle super index operations like `super[a] = b`, `super[a] += b`, and |
3226 /// `super[a]++`. | 3230 /// `super[a]++`. |
3227 // TODO(johnniwinther): Share code with [handleIndexSendSet]. | 3231 // TODO(johnniwinther): Share code with [handleIndexSendSet]. |
3228 ResolutionResult handleSuperIndexSendSet(SendSet node) { | 3232 ResolutionResult handleSuperIndexSendSet(SendSet node) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3331 | 3335 |
3332 // TODO(23998): Remove these when selectors are only accessed | 3336 // TODO(23998): Remove these when selectors are only accessed |
3333 // through the send structure. | 3337 // through the send structure. |
3334 registry.setGetterSelectorInComplexSendSet(node, getterSelector); | 3338 registry.setGetterSelectorInComplexSendSet(node, getterSelector); |
3335 registry.setSelector(node, setterSelector); | 3339 registry.setSelector(node, setterSelector); |
3336 registry.setOperatorSelectorInComplexSendSet(node, operatorSelector); | 3340 registry.setOperatorSelectorInComplexSendSet(node, operatorSelector); |
3337 | 3341 |
3338 registry.registerDynamicUse( | 3342 registry.registerDynamicUse( |
3339 new DynamicUse(operatorSelector, null)); | 3343 new DynamicUse(operatorSelector, null)); |
3340 | 3344 |
3341 SendStructure sendStructure = | 3345 SendStructure sendStructure; |
3342 new CompoundIndexSetStructure(semantics, operator); | 3346 if (operator.kind == AssignmentOperatorKind.IF_NULL) { |
| 3347 sendStructure = new IndexSetIfNullStructure(semantics); |
| 3348 } else { |
| 3349 sendStructure = new CompoundIndexSetStructure(semantics, operator); |
| 3350 } |
3343 registry.registerSendStructure(node, sendStructure); | 3351 registry.registerSendStructure(node, sendStructure); |
3344 return const NoneResult(); | 3352 return const NoneResult(); |
3345 } | 3353 } |
3346 } | 3354 } |
3347 } | 3355 } |
3348 | 3356 |
3349 /// Handle super index operations like `super.a = b`, `super.a += b`, and | 3357 /// Handle super index operations like `super.a = b`, `super.a += b`, and |
3350 /// `super.a++`. | 3358 /// `super.a++`. |
3351 // TODO(johnniwinther): Share code with [handleSuperIndexSendSet]. | 3359 // TODO(johnniwinther): Share code with [handleSuperIndexSendSet]. |
3352 ResolutionResult handleSuperSendSet(SendSet node) { | 3360 ResolutionResult handleSuperSendSet(SendSet node) { |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4870 } | 4878 } |
4871 return const NoneResult(); | 4879 return const NoneResult(); |
4872 } | 4880 } |
4873 } | 4881 } |
4874 | 4882 |
4875 /// Looks up [name] in [scope] and unwraps the result. | 4883 /// Looks up [name] in [scope] and unwraps the result. |
4876 Element lookupInScope(DiagnosticReporter reporter, Node node, | 4884 Element lookupInScope(DiagnosticReporter reporter, Node node, |
4877 Scope scope, String name) { | 4885 Scope scope, String name) { |
4878 return Elements.unwrap(scope.lookup(name), reporter, node); | 4886 return Elements.unwrap(scope.lookup(name), reporter, node); |
4879 } | 4887 } |
OLD | NEW |