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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 ConstantExpression visitTopLevelFieldGet(Send node, FieldElement field, _) { | 278 ConstantExpression visitTopLevelFieldGet(Send node, FieldElement field, _) { |
279 return new VariableConstantExpression(field); | 279 return new VariableConstantExpression(field); |
280 } | 280 } |
281 | 281 |
282 @override | 282 @override |
283 ConstantExpression visitLiteralInt(LiteralInt node) { | 283 ConstantExpression visitLiteralInt(LiteralInt node) { |
284 return new IntConstantExpression(node.value); | 284 return new IntConstantExpression(node.value); |
285 } | 285 } |
286 | 286 |
287 @override | 287 @override |
| 288 ConstantExpression visitLiteralDouble(LiteralDouble node) { |
| 289 return new DoubleConstantExpression(node.value); |
| 290 } |
| 291 |
| 292 @override |
288 ConstantExpression visitLiteralBool(LiteralBool node) { | 293 ConstantExpression visitLiteralBool(LiteralBool node) { |
289 return new BoolConstantExpression(node.value); | 294 return new BoolConstantExpression(node.value); |
290 } | 295 } |
291 | 296 |
292 @override | 297 @override |
293 ConstantExpression visitLiteralNull(LiteralNull node) { | 298 ConstantExpression visitLiteralNull(LiteralNull node) { |
294 return new NullConstantExpression(); | 299 return new NullConstantExpression(); |
295 } | 300 } |
296 | 301 |
297 @override | 302 @override |
(...skipping 25 matching lines...) Expand all Loading... |
323 } | 328 } |
324 return new IdenticalConstantExpression( | 329 return new IdenticalConstantExpression( |
325 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); | 330 apply(arguments.nodes.head), apply(arguments.nodes.tail.head)); |
326 } | 331 } |
327 | 332 |
328 @override | 333 @override |
329 ConstantExpression visitNamedArgument(NamedArgument node) { | 334 ConstantExpression visitNamedArgument(NamedArgument node) { |
330 return apply(node.expression); | 335 return apply(node.expression); |
331 } | 336 } |
332 } | 337 } |
OLD | NEW |