OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:js_runtime/shared/embedded_names.dart'; | 5 import 'package:js_runtime/shared/embedded_names.dart'; |
6 import 'package:kernel/ast.dart' as ir; | 6 import 'package:kernel/ast.dart' as ir; |
7 | 7 |
8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return new Selector.getter(name); | 191 return new Selector.getter(name); |
192 } | 192 } |
193 | 193 |
194 Selector getSetterSelector(ir.PropertySet setter) { | 194 Selector getSetterSelector(ir.PropertySet setter) { |
195 ir.Name irName = setter.name; | 195 ir.Name irName = setter.name; |
196 Name name = new Name( | 196 Name name = new Name( |
197 irName.name, irName.isPrivate ? getElement(irName.library) : null); | 197 irName.name, irName.isPrivate ? getElement(irName.library) : null); |
198 return new Selector.setter(name); | 198 return new Selector.setter(name); |
199 } | 199 } |
200 | 200 |
201 TypeMask typeOfInvocation(ir.Expression send) { | 201 TypeMask typeOfInvocation(ir.MethodInvocation send) { |
202 ast.Node operatorNode = kernel.nodeToAstOperator[send]; | 202 ast.Node operatorNode = kernel.nodeToAstOperator[send]; |
203 if (operatorNode != null) { | 203 if (operatorNode != null) { |
204 return _resultOf(_target).typeOfOperator(operatorNode); | 204 return _resultOf(_target).typeOfOperator(operatorNode); |
205 } | 205 } |
| 206 if (send.name.name == '[]=') { |
| 207 return _compiler.closedWorld.commonMasks.dynamicType; |
| 208 } |
206 return _resultOf(_target).typeOfSend(getNode(send)); | 209 return _resultOf(_target).typeOfSend(getNode(send)); |
207 } | 210 } |
208 | 211 |
209 TypeMask typeOfGet(ir.PropertyGet getter) { | 212 TypeMask typeOfGet(ir.PropertyGet getter) { |
210 return _resultOf(_target).typeOfSend(getNode(getter)); | 213 return _resultOf(_target).typeOfSend(getNode(getter)); |
211 } | 214 } |
212 | 215 |
213 TypeMask typeOfSet(ir.PropertySet setter) { | 216 TypeMask typeOfSet(ir.PropertySet setter) { |
214 return _compiler.closedWorld.commonMasks.dynamicType; | 217 return _compiler.closedWorld.commonMasks.dynamicType; |
215 } | 218 } |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 astAdapter.reporter.internalError( | 833 astAdapter.reporter.internalError( |
831 CURRENT_ELEMENT_SPANNABLE, "Unexpected constant target: $element."); | 834 CURRENT_ELEMENT_SPANNABLE, "Unexpected constant target: $element."); |
832 return null; | 835 return null; |
833 } | 836 } |
834 | 837 |
835 @override | 838 @override |
836 ConstantExpression visitStringLiteral(ir.StringLiteral node) { | 839 ConstantExpression visitStringLiteral(ir.StringLiteral node) { |
837 return new StringConstantExpression(node.value); | 840 return new StringConstantExpression(node.value); |
838 } | 841 } |
839 } | 842 } |
OLD | NEW |