OLD | NEW |
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 '../common_elements.dart'; | 9 import '../common_elements.dart'; |
10 import '../elements/types.dart'; | 10 import '../elements/types.dart'; |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 .lookupBinary(operator) | 934 .lookupBinary(operator) |
935 .fold(leftValue, rightValue); | 935 .fold(leftValue, rightValue); |
936 } | 936 } |
937 } | 937 } |
938 | 938 |
939 ConstantExpression apply(NormalizedArguments arguments) { | 939 ConstantExpression apply(NormalizedArguments arguments) { |
940 return new BinaryConstantExpression( | 940 return new BinaryConstantExpression( |
941 left.apply(arguments), operator, right.apply(arguments)); | 941 left.apply(arguments), operator, right.apply(arguments)); |
942 } | 942 } |
943 | 943 |
| 944 // ignore: MISSING_RETURN |
944 InterfaceType getKnownType(CommonElements commonElements) { | 945 InterfaceType getKnownType(CommonElements commonElements) { |
945 DartType knownLeftType = left.getKnownType(commonElements); | 946 DartType knownLeftType = left.getKnownType(commonElements); |
946 DartType knownRightType = right.getKnownType(commonElements); | 947 DartType knownRightType = right.getKnownType(commonElements); |
947 switch (operator.kind) { | 948 switch (operator.kind) { |
948 case BinaryOperatorKind.EQ: | 949 case BinaryOperatorKind.EQ: |
949 case BinaryOperatorKind.NOT_EQ: | 950 case BinaryOperatorKind.NOT_EQ: |
950 case BinaryOperatorKind.LOGICAL_AND: | 951 case BinaryOperatorKind.LOGICAL_AND: |
951 case BinaryOperatorKind.LOGICAL_OR: | 952 case BinaryOperatorKind.LOGICAL_OR: |
952 case BinaryOperatorKind.GT: | 953 case BinaryOperatorKind.GT: |
953 case BinaryOperatorKind.LT: | 954 case BinaryOperatorKind.LT: |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 visit(exp.name); | 1942 visit(exp.name); |
1942 if (exp.defaultValue != null) { | 1943 if (exp.defaultValue != null) { |
1943 sb.write(', defaultValue: '); | 1944 sb.write(', defaultValue: '); |
1944 visit(exp.defaultValue); | 1945 visit(exp.defaultValue); |
1945 } | 1946 } |
1946 sb.write(')'); | 1947 sb.write(')'); |
1947 } | 1948 } |
1948 | 1949 |
1949 String toString() => sb.toString(); | 1950 String toString() => sb.toString(); |
1950 } | 1951 } |
OLD | NEW |