| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.send_structure; | 5 library dart2js.resolution.send_structure; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2256 kind = ConstantInvokeKind.BOOL_FROM_ENVIRONMENT; | 2256 kind = ConstantInvokeKind.BOOL_FROM_ENVIRONMENT; |
| 2257 break; | 2257 break; |
| 2258 case ConstantExpressionKind.INT_FROM_ENVIRONMENT: | 2258 case ConstantExpressionKind.INT_FROM_ENVIRONMENT: |
| 2259 kind = ConstantInvokeKind.INT_FROM_ENVIRONMENT; | 2259 kind = ConstantInvokeKind.INT_FROM_ENVIRONMENT; |
| 2260 break; | 2260 break; |
| 2261 case ConstantExpressionKind.STRING_FROM_ENVIRONMENT: | 2261 case ConstantExpressionKind.STRING_FROM_ENVIRONMENT: |
| 2262 kind = ConstantInvokeKind.STRING_FROM_ENVIRONMENT; | 2262 kind = ConstantInvokeKind.STRING_FROM_ENVIRONMENT; |
| 2263 break; | 2263 break; |
| 2264 default: | 2264 default: |
| 2265 throw new SpannableAssertionFailure( | 2265 throw new SpannableAssertionFailure( |
| 2266 node, "Unexpected constant kind $kind: ${constant.getText()}"); | 2266 node, "Unexpected constant kind $kind: ${constant.toDartText()}"); |
| 2267 } | 2267 } |
| 2268 return new ConstInvokeStructure(kind, constant); | 2268 return new ConstInvokeStructure(kind, constant); |
| 2269 } | 2269 } |
| 2270 } | 2270 } |
| 2271 | 2271 |
| 2272 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg) { | 2272 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg) { |
| 2273 Element element = elements[node.send]; | 2273 Element element = elements[node.send]; |
| 2274 Selector selector = elements.getSelector(node.send); | 2274 Selector selector = elements.getSelector(node.send); |
| 2275 DartType type = elements.getType(node); | 2275 DartType type = elements.getType(node); |
| 2276 ConstantExpression constant = elements.getConstant(node); | 2276 ConstantExpression constant = elements.getConstant(node); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2290 return visitor.visitBoolFromEnvironmentConstructorInvoke( | 2290 return visitor.visitBoolFromEnvironmentConstructorInvoke( |
| 2291 node, constant, arg); | 2291 node, constant, arg); |
| 2292 case ConstantExpressionKind.INT_FROM_ENVIRONMENT: | 2292 case ConstantExpressionKind.INT_FROM_ENVIRONMENT: |
| 2293 return visitor.visitIntFromEnvironmentConstructorInvoke( | 2293 return visitor.visitIntFromEnvironmentConstructorInvoke( |
| 2294 node, constant, arg); | 2294 node, constant, arg); |
| 2295 case ConstantExpressionKind.STRING_FROM_ENVIRONMENT: | 2295 case ConstantExpressionKind.STRING_FROM_ENVIRONMENT: |
| 2296 return visitor.visitStringFromEnvironmentConstructorInvoke( | 2296 return visitor.visitStringFromEnvironmentConstructorInvoke( |
| 2297 node, constant, arg); | 2297 node, constant, arg); |
| 2298 default: | 2298 default: |
| 2299 throw new SpannableAssertionFailure( | 2299 throw new SpannableAssertionFailure( |
| 2300 node, "Unexpected constant kind $kind: ${constant.getText()}"); | 2300 node, "Unexpected constant kind $kind: ${constant.toDartText()}"); |
| 2301 } | 2301 } |
| 2302 } | 2302 } |
| 2303 } | 2303 } |
| 2304 } | 2304 } |
| 2305 | 2305 |
| 2306 /// The structure of a parameter declaration. | 2306 /// The structure of a parameter declaration. |
| 2307 abstract class ParameterStructure<R, A> { | 2307 abstract class ParameterStructure<R, A> { |
| 2308 final VariableDefinitions definitions; | 2308 final VariableDefinitions definitions; |
| 2309 final Node node; | 2309 final Node node; |
| 2310 final ParameterElement parameter; | 2310 final ParameterElement parameter; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2510 ThisConstructorInvokeStructure( | 2510 ThisConstructorInvokeStructure( |
| 2511 this.node, this.constructor, this.callStructure); | 2511 this.node, this.constructor, this.callStructure); |
| 2512 | 2512 |
| 2513 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { | 2513 R dispatch(SemanticDeclarationVisitor<R, A> visitor, A arg) { |
| 2514 return visitor.visitThisConstructorInvoke( | 2514 return visitor.visitThisConstructorInvoke( |
| 2515 node, constructor, node.argumentsNode, callStructure, arg); | 2515 node, constructor, node.argumentsNode, callStructure, arg); |
| 2516 } | 2516 } |
| 2517 | 2517 |
| 2518 bool get isConstructorInvoke => true; | 2518 bool get isConstructorInvoke => true; |
| 2519 } | 2519 } |
| OLD | NEW |