Chromium Code Reviews| 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 // TODO(johnniwinther): Remove this library when all constant constructors are | 5 // TODO(johnniwinther): Remove this library when all constant constructors are |
| 6 // computed during resolution. | 6 // computed during resolution. |
| 7 library dart2js.constants.constant_constructors; | 7 library dart2js.constants.constant_constructors; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../elements/resolution_types.dart'; | 10 import '../elements/resolution_types.dart'; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 Send node, UnaryOperator operator, Node expression, _) { | 284 Send node, UnaryOperator operator, Node expression, _) { |
| 285 return new UnaryConstantExpression(operator, apply(expression)); | 285 return new UnaryConstantExpression(operator, apply(expression)); |
| 286 } | 286 } |
| 287 | 287 |
| 288 @override | 288 @override |
| 289 ConstantExpression visitStaticFieldGet(Send node, FieldElement field, _) { | 289 ConstantExpression visitStaticFieldGet(Send node, FieldElement field, _) { |
| 290 return new VariableConstantExpression(field); | 290 return new VariableConstantExpression(field); |
| 291 } | 291 } |
| 292 | 292 |
| 293 @override | 293 @override |
| 294 ConstantExpression visitTopLevelFunctionGet( | |
|
Johnni Winther
2017/01/31 13:05:16
Needed to handle dart2js_resolver_test on the adde
| |
| 295 Send node, MethodElement method, _) { | |
| 296 return new FunctionConstantExpression(method); | |
| 297 } | |
| 298 | |
| 299 @override | |
| 294 ConstantExpression visitTopLevelFieldGet(Send node, FieldElement field, _) { | 300 ConstantExpression visitTopLevelFieldGet(Send node, FieldElement field, _) { |
| 295 return new VariableConstantExpression(field); | 301 return new VariableConstantExpression(field); |
| 296 } | 302 } |
| 297 | 303 |
| 298 @override | 304 @override |
| 299 ConstantExpression visitLiteralInt(LiteralInt node) { | 305 ConstantExpression visitLiteralInt(LiteralInt node) { |
| 300 return new IntConstantExpression(node.value); | 306 return new IntConstantExpression(node.value); |
| 301 } | 307 } |
| 302 | 308 |
| 303 @override | 309 @override |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 350 ConstantExpression visitNamedArgument(NamedArgument node) { | 356 ConstantExpression visitNamedArgument(NamedArgument node) { |
| 351 return apply(node.expression); | 357 return apply(node.expression); |
| 352 } | 358 } |
| 353 | 359 |
| 354 @override | 360 @override |
| 355 ConstantExpression visitIfNull(Send node, Node left, Node right, _) { | 361 ConstantExpression visitIfNull(Send node, Node left, Node right, _) { |
| 356 return new BinaryConstantExpression( | 362 return new BinaryConstantExpression( |
| 357 apply(left), BinaryOperator.IF_NULL, apply(right)); | 363 apply(left), BinaryOperator.IF_NULL, apply(right)); |
| 358 } | 364 } |
| 359 } | 365 } |
| OLD | NEW |