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 Selectors; | 8 import '../common/names.dart' show Selectors; |
9 import '../common/resolution.dart' show Resolution; | 9 import '../common/resolution.dart' show Resolution; |
10 import '../compile_time_constants.dart'; | 10 import '../compile_time_constants.dart'; |
(...skipping 3391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3402 // through the send structure. | 3402 // through the send structure. |
3403 registry.useElement(node, semantics.setter); | 3403 registry.useElement(node, semantics.setter); |
3404 registry.useElement(node.selector, semantics.getter); | 3404 registry.useElement(node.selector, semantics.getter); |
3405 | 3405 |
3406 registry.registerDynamicUse(new DynamicUse(operatorSelector, null)); | 3406 registry.registerDynamicUse(new DynamicUse(operatorSelector, null)); |
3407 | 3407 |
3408 SendStructure sendStructure = node.isPrefix | 3408 SendStructure sendStructure = node.isPrefix |
3409 ? new PrefixStructure(semantics, operator) | 3409 ? new PrefixStructure(semantics, operator) |
3410 : new PostfixStructure(semantics, operator); | 3410 : new PostfixStructure(semantics, operator); |
3411 registry.registerSendStructure(node, sendStructure); | 3411 registry.registerSendStructure(node, sendStructure); |
3412 registry.registerFeature(Feature.INC_DEC_OPERATION); | 3412 registry.registerConstantLiteral(new IntConstantExpression(1)); |
3413 } else { | 3413 } else { |
3414 Node rhs = node.arguments.head; | 3414 Node rhs = node.arguments.head; |
3415 visitExpression(rhs); | 3415 visitExpression(rhs); |
3416 | 3416 |
3417 AssignmentOperator operator = AssignmentOperator.parse(operatorText); | 3417 AssignmentOperator operator = AssignmentOperator.parse(operatorText); |
3418 if (operator.kind == AssignmentOperatorKind.ASSIGN) { | 3418 if (operator.kind == AssignmentOperatorKind.ASSIGN) { |
3419 // `e1 = e2`. | 3419 // `e1 = e2`. |
3420 | 3420 |
3421 // TODO(23998): Remove these when elements are only accessed | 3421 // TODO(23998): Remove these when elements are only accessed |
3422 // through the send structure. | 3422 // through the send structure. |
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4728 } | 4728 } |
4729 return const NoneResult(); | 4729 return const NoneResult(); |
4730 } | 4730 } |
4731 } | 4731 } |
4732 | 4732 |
4733 /// Looks up [name] in [scope] and unwraps the result. | 4733 /// Looks up [name] in [scope] and unwraps the result. |
4734 Element lookupInScope( | 4734 Element lookupInScope( |
4735 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4735 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
4736 return Elements.unwrap(scope.lookup(name), reporter, node); | 4736 return Elements.unwrap(scope.lookup(name), reporter, node); |
4737 } | 4737 } |
OLD | NEW |