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

Unified Diff: tests/compiler/dart2js/serialization/helper.dart

Issue 1994613004: Handle use of constant constructors with default values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 4 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/serialization/helper.dart
diff --git a/tests/compiler/dart2js/serialization/helper.dart b/tests/compiler/dart2js/serialization/helper.dart
index 1ce8c2bd1fff8a3acc8890435bc9b15fcc124d58..cde182f22e2b5ff548f7a41838936ca591c4c278 100644
--- a/tests/compiler/dart2js/serialization/helper.dart
+++ b/tests/compiler/dart2js/serialization/helper.dart
@@ -14,6 +14,8 @@ import 'package:compiler/src/compiler.dart';
import '../memory_compiler.dart';
import 'test_data.dart';
+const String DEFAULT_DATA_FILE_NAME = 'out.data';
+
class Arguments {
final String filename;
final int start;
@@ -29,7 +31,7 @@ class Arguments {
this.end,
this.loadSerializedData: false,
this.saveSerializedData: false,
- this.serializedDataFileName: 'out.data',
+ this.serializedDataFileName: DEFAULT_DATA_FILE_NAME,
this.verbose: false});
factory Arguments.from(List<String> arguments) {
@@ -38,7 +40,7 @@ class Arguments {
int end;
for (String arg in arguments) {
if (!arg.startsWith('-')) {
- int index = int.parse(arg);
+ int index = int.parse(arg, onError: (_) => null);
if (index == null) {
filename = arg;
} else if (start == null) {
@@ -51,6 +53,14 @@ class Arguments {
bool verbose = arguments.contains('-v');
bool loadSerializedData = arguments.contains('-l');
bool saveSerializedData = arguments.contains('-s');
+ if (arguments.contains('--auto')) {
+ File file = new File(DEFAULT_DATA_FILE_NAME);
+ if (file.existsSync()) {
+ loadSerializedData = true;
+ } else {
+ saveSerializedData = true;
+ }
+ }
return new Arguments(
filename: filename,
start: start,
« no previous file with comments | « tests/compiler/dart2js/serialization/equivalence_test.dart ('k') | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698