OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:compiler/src/elements/elements.dart'; | 5 import 'package:compiler/src/elements/elements.dart'; |
6 import 'package:compiler/src/resolution/access_semantics.dart'; | 6 import 'package:compiler/src/resolution/access_semantics.dart'; |
7 import 'package:compiler/src/resolution/send_structure.dart'; | 7 import 'package:compiler/src/resolution/send_structure.dart'; |
8 import 'package:compiler/src/resolution/tree_elements.dart'; | 8 import 'package:compiler/src/resolution/tree_elements.dart'; |
9 import 'package:compiler/src/tree/nodes.dart' as ast; | 9 import 'package:compiler/src/tree/nodes.dart' as ast; |
10 import 'package:kernel/ast.dart' as ir; | 10 import 'package:kernel/ast.dart' as ir; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 NodeId computeAccessId(ast.Send node, AccessSemantics access) { | 83 NodeId computeAccessId(ast.Send node, AccessSemantics access) { |
84 switch (access.kind) { | 84 switch (access.kind) { |
85 case AccessKind.DYNAMIC_PROPERTY: | 85 case AccessKind.DYNAMIC_PROPERTY: |
86 return new NodeId(node.selector.getBeginToken().charOffset); | 86 return new NodeId(node.selector.getBeginToken().charOffset); |
87 default: | 87 default: |
88 return new NodeId(node.getBeginToken().charOffset); | 88 return new NodeId(node.getBeginToken().charOffset); |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 NodeId computeNodeId(ast.Send node) { | 92 NodeId computeNodeId(ast.Send node) { |
93 var sendStructure = elements.getSendStructure(node); | 93 dynamic sendStructure = elements.getSendStructure(node); |
94 if (sendStructure == null) return null; | 94 if (sendStructure == null) return null; |
95 switch (sendStructure.kind) { | 95 switch (sendStructure.kind) { |
96 case SendStructureKind.GET: | 96 case SendStructureKind.GET: |
97 case SendStructureKind.INVOKE: | 97 case SendStructureKind.INVOKE: |
98 case SendStructureKind.INCOMPATIBLE_INVOKE: | 98 case SendStructureKind.INCOMPATIBLE_INVOKE: |
99 return computeAccessId(node, sendStructure.semantics); | 99 return computeAccessId(node, sendStructure.semantics); |
100 default: | 100 default: |
101 return new NodeId(node.getBeginToken().charOffset); | 101 return new NodeId(node.getBeginToken().charOffset); |
102 } | 102 } |
103 } | 103 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 if (found == null) { | 228 if (found == null) { |
229 Id id = computeElementId(node); | 229 Id id = computeElementId(node); |
230 if (id == soughtId) { | 230 if (id == soughtId) { |
231 found = node; | 231 found = node; |
232 return; | 232 return; |
233 } | 233 } |
234 defaultNode(node); | 234 defaultNode(node); |
235 } | 235 } |
236 } | 236 } |
237 } | 237 } |
OLD | NEW |