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

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

Issue 1493693002: Make ?? a compile-time constant operator. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Move VM/analyzer parts to separate CLs. Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js.constants.expressions; 5 library dart2js.constants.expressions;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/constant_system.dart'; 8 import '../constants/constant_system.dart';
9 import '../core_types.dart'; 9 import '../core_types.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 BinaryOperatorKind.ADD: 12, 797 BinaryOperatorKind.ADD: 12,
798 BinaryOperatorKind.SUB: 12, 798 BinaryOperatorKind.SUB: 12,
799 BinaryOperatorKind.MUL: 13, 799 BinaryOperatorKind.MUL: 13,
800 BinaryOperatorKind.DIV: 13, 800 BinaryOperatorKind.DIV: 13,
801 BinaryOperatorKind.IDIV: 13, 801 BinaryOperatorKind.IDIV: 13,
802 BinaryOperatorKind.GT: 7, 802 BinaryOperatorKind.GT: 7,
803 BinaryOperatorKind.LT: 7, 803 BinaryOperatorKind.LT: 7,
804 BinaryOperatorKind.GTEQ: 7, 804 BinaryOperatorKind.GTEQ: 7,
805 BinaryOperatorKind.LTEQ: 7, 805 BinaryOperatorKind.LTEQ: 7,
806 BinaryOperatorKind.MOD: 13, 806 BinaryOperatorKind.MOD: 13,
807 BinaryOperatorKind.IF_NULL: 3,
807 }; 808 };
808 } 809 }
809 810
810 /// A constant identical invocation like `identical(a, b)`. 811 /// A constant identical invocation like `identical(a, b)`.
811 class IdenticalConstantExpression extends ConstantExpression { 812 class IdenticalConstantExpression extends ConstantExpression {
812 final ConstantExpression left; 813 final ConstantExpression left;
813 final ConstantExpression right; 814 final ConstantExpression right;
814 815
815 IdenticalConstantExpression(this.left, this.right); 816 IdenticalConstantExpression(this.left, this.right);
816 817
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 sb.write('const String.fromEnvironment('); 1599 sb.write('const String.fromEnvironment(');
1599 visit(exp.name); 1600 visit(exp.name);
1600 if (exp.defaultValue != null) { 1601 if (exp.defaultValue != null) {
1601 sb.write(', defaultValue: '); 1602 sb.write(', defaultValue: ');
1602 visit(exp.defaultValue); 1603 visit(exp.defaultValue);
1603 } 1604 }
1604 sb.write(')'); 1605 sb.write(')');
1605 } 1606 }
1606 1607
1607 String toString() => sb.toString(); 1608 String toString() => sb.toString();
1608 } 1609 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/constant_system.dart ('k') | pkg/compiler/lib/src/js_backend/constant_system_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698