| 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 '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 throw new UnsupportedError("Unexpected function call: $function"); | 332 throw new UnsupportedError("Unexpected function call: $function"); |
| 333 } | 333 } |
| 334 return new IdenticalConstantExpression( | 334 return new IdenticalConstantExpression( |
| 335 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); | 335 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); |
| 336 } | 336 } |
| 337 | 337 |
| 338 @override | 338 @override |
| 339 ConstantExpression visitNamedArgument(NamedArgument node) { | 339 ConstantExpression visitNamedArgument(NamedArgument node) { |
| 340 return apply(node.expression); | 340 return apply(node.expression); |
| 341 } | 341 } |
| 342 |
| 343 @override |
| 344 ConstantExpression visitIfNull(Send node, Node left, Node right, _) { |
| 345 return new BinaryConstantExpression( |
| 346 apply(left), BinaryOperator.IF_NULL, apply(right)); |
| 347 } |
| 342 } | 348 } |
| OLD | NEW |