Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Side by Side Diff: pkg/compiler/lib/src/constants/constant_constructors.dart

Issue 2102553002: Handle double literals in constant constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698