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

Side by Side Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2866463005: Handle ?? in Constantifier (Closed)
Patch Set: Created 3 years, 7 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.kernel.impact_test; 5 library dart2js.kernel.impact_test;
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:compiler/src/commandline_options.dart'; 8 import 'package:compiler/src/commandline_options.dart';
9 import 'package:compiler/src/common.dart'; 9 import 'package:compiler/src/common.dart';
10 import 'package:compiler/src/common/names.dart'; 10 import 'package:compiler/src/common/names.dart';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 testFalse(); 50 testFalse();
51 testInt(); 51 testInt();
52 testDouble(); 52 testDouble();
53 testString(); 53 testString();
54 testStringInterpolation(); 54 testStringInterpolation();
55 testStringInterpolationConst(); 55 testStringInterpolationConst();
56 testStringJuxtaposition(); 56 testStringJuxtaposition();
57 testSymbol(); 57 testSymbol();
58 testConstSymbol(); 58 testConstSymbol();
59 testComplexConstSymbol(); 59 testComplexConstSymbol();
60 testIfNullConstSymbol();
60 testTypeLiteral(); 61 testTypeLiteral();
61 testBoolFromEnvironment(); 62 testBoolFromEnvironment();
62 testEmptyListLiteral(); 63 testEmptyListLiteral();
63 testEmptyListLiteralDynamic(); 64 testEmptyListLiteralDynamic();
64 testEmptyListLiteralTyped(); 65 testEmptyListLiteralTyped();
65 testEmptyListLiteralConstant(); 66 testEmptyListLiteralConstant();
66 testNonEmptyListLiteral(); 67 testNonEmptyListLiteral();
67 testEmptyMapLiteral(); 68 testEmptyMapLiteral();
68 testEmptyMapLiteralDynamic(); 69 testEmptyMapLiteralDynamic();
69 testEmptyMapLiteralTyped(); 70 testEmptyMapLiteralTyped();
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 const <int>[]: const String.fromEnvironment('c'), 228 const <int>[]: const String.fromEnvironment('c'),
228 testComplexConstSymbol: #testComplexConstSymbol, 229 testComplexConstSymbol: #testComplexConstSymbol,
229 1 + 2: identical(0, -0), 230 1 + 2: identical(0, -0),
230 true || false: false && true, 231 true || false: false && true,
231 override: const GenericClass<int, String>.generative(), 232 override: const GenericClass<int, String>.generative(),
232 }; 233 };
233 const complexSymbolField = 234 const complexSymbolField =
234 complexSymbolField1 ? complexSymbolField2 : complexSymbolField3; 235 complexSymbolField1 ? complexSymbolField2 : complexSymbolField3;
235 testComplexConstSymbol() => const Symbol(complexSymbolField); 236 testComplexConstSymbol() => const Symbol(complexSymbolField);
236 237
238 testIfNullConstSymbol() => const Symbol(null ?? 'foo');
239
237 testTypeLiteral() => Object; 240 testTypeLiteral() => Object;
238 testBoolFromEnvironment() => const bool.fromEnvironment('FOO'); 241 testBoolFromEnvironment() => const bool.fromEnvironment('FOO');
239 testEmptyListLiteral() => []; 242 testEmptyListLiteral() => [];
240 testEmptyListLiteralDynamic() => <dynamic>[]; 243 testEmptyListLiteralDynamic() => <dynamic>[];
241 testEmptyListLiteralTyped() => <String>[]; 244 testEmptyListLiteralTyped() => <String>[];
242 testEmptyListLiteralConstant() => const []; 245 testEmptyListLiteralConstant() => const [];
243 testNonEmptyListLiteral() => [0]; 246 testNonEmptyListLiteral() => [0];
244 testEmptyMapLiteral() => {}; 247 testEmptyMapLiteral() => {};
245 testEmptyMapLiteralDynamic() => <dynamic, dynamic>{}; 248 testEmptyMapLiteralDynamic() => <dynamic, dynamic>{};
246 testEmptyMapLiteralTyped() => <String, int>{}; 249 testEmptyMapLiteralTyped() => <String, int>{};
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 visitList(type.optionalParameterTypes), 939 visitList(type.optionalParameterTypes),
937 type.namedParameters, 940 type.namedParameters,
938 visitList(type.namedParameterTypes)); 941 visitList(type.namedParameterTypes));
939 } 942 }
940 } 943 }
941 944
942 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType]. 945 /// Perform unaliasing of all typedefs nested within a [ResolutionDartType].
943 ResolutionDartType unalias(ResolutionDartType type) { 946 ResolutionDartType unalias(ResolutionDartType type) {
944 return const Unaliaser().visit(type); 947 return const Unaliaser().visit(type);
945 } 948 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698