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

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

Issue 2116483002: Handle constant ?? expressions in 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 | pkg/compiler/lib/src/dart2js.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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698