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:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
11 import '../constants/values.dart'; | 11 import '../constants/values.dart'; |
12 import '../common_elements.dart'; | 12 import '../common_elements.dart'; |
13 import '../elements/elements.dart'; | |
14 import '../elements/entities.dart'; | 13 import '../elements/entities.dart'; |
15 import '../elements/names.dart'; | 14 import '../elements/names.dart'; |
16 import '../elements/operators.dart'; | 15 import '../elements/operators.dart'; |
17 import '../elements/types.dart'; | 16 import '../elements/types.dart'; |
18 import '../js_backend/backend.dart' show JavaScriptBackend; | 17 import '../js_backend/backend.dart' show JavaScriptBackend; |
19 import '../native/native.dart' as native; | 18 import '../native/native.dart' as native; |
20 import '../universe/call_structure.dart'; | 19 import '../universe/call_structure.dart'; |
21 import '../universe/selector.dart'; | 20 import '../universe/selector.dart'; |
22 import 'kernel_debug.dart'; | 21 import 'kernel_debug.dart'; |
23 | 22 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 166 } |
168 throw new SpannableAssertionFailure( | 167 throw new SpannableAssertionFailure( |
169 CURRENT_ELEMENT_SPANNABLE, | 168 CURRENT_ELEMENT_SPANNABLE, |
170 "Can only get the selector for a property get or an invocation: " | 169 "Can only get the selector for a property get or an invocation: " |
171 "${node}"); | 170 "${node}"); |
172 } | 171 } |
173 | 172 |
174 Selector getInvocationSelector(ir.InvocationExpression invocation) { | 173 Selector getInvocationSelector(ir.InvocationExpression invocation) { |
175 Name name = getName(invocation.name); | 174 Name name = getName(invocation.name); |
176 SelectorKind kind; | 175 SelectorKind kind; |
177 if (Elements.isOperatorName(invocation.name.name)) { | 176 if (Selector.isOperatorName(name.text)) { |
178 if (name == Names.INDEX_NAME || name == Names.INDEX_SET_NAME) { | 177 if (name == Names.INDEX_NAME || name == Names.INDEX_SET_NAME) { |
179 kind = SelectorKind.INDEX; | 178 kind = SelectorKind.INDEX; |
180 } else { | 179 } else { |
181 kind = SelectorKind.OPERATOR; | 180 kind = SelectorKind.OPERATOR; |
182 } | 181 } |
183 } else { | 182 } else { |
184 kind = SelectorKind.CALL; | 183 kind = SelectorKind.CALL; |
185 } | 184 } |
186 | 185 |
187 CallStructure callStructure = getCallStructure(invocation.arguments); | 186 CallStructure callStructure = getCallStructure(invocation.arguments); |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 } | 814 } |
816 if (isRedirecting) { | 815 if (isRedirecting) { |
817 return new RedirectingGenerativeConstantConstructor( | 816 return new RedirectingGenerativeConstantConstructor( |
818 defaultValues, superConstructorInvocation); | 817 defaultValues, superConstructorInvocation); |
819 } else { | 818 } else { |
820 return new GenerativeConstantConstructor( | 819 return new GenerativeConstantConstructor( |
821 type, defaultValues, fieldMap, superConstructorInvocation); | 820 type, defaultValues, fieldMap, superConstructorInvocation); |
822 } | 821 } |
823 } | 822 } |
824 } | 823 } |
OLD | NEW |