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

Unified Diff: lib/src/executable.dart

Issue 1272813003: Support "--checked" in pub run and global run. (Closed) Base URL: https://github.com/dart-lang/pub.git@master
Patch Set: Created 5 years, 4 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: lib/src/executable.dart
diff --git a/lib/src/executable.dart b/lib/src/executable.dart
index 62c33a1c6c1499296c65354e5990e7c0bbe735a7..cd14e32543ff85f85afbdd3e4a76cf74676a9f3f 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -44,13 +44,13 @@ final _catchableSignals = Platform.isWindows
///
/// Arguments from [args] will be passed to the spawned Dart application.
///
-/// If [mode] is passed, it's used as the barback mode; it defaults to
-/// [BarbackMode.RELEASE].
+/// If [checked] is true, the program is run in checked mode. If [mode] is
+/// passed, it's used as the barback mode; it defaults to [BarbackMode.RELEASE].
///
/// Returns the exit code of the spawned app.
Future<int> runExecutable(Entrypoint entrypoint, String package,
String executable, Iterable<String> args, {bool isGlobal: false,
- BarbackMode mode}) async {
+ bool checked: false, BarbackMode mode}) async {
if (mode == null) mode = BarbackMode.RELEASE;
// Make sure the package is an immediate dependency of the entrypoint or the
@@ -84,7 +84,8 @@ Future<int> runExecutable(Entrypoint entrypoint, String package,
// default mode for them to run. We can't run them in a different mode
// using the snapshot.
mode == BarbackMode.RELEASE) {
- return _runCachedExecutable(entrypoint, localSnapshotPath, args);
+ return _runCachedExecutable(entrypoint, localSnapshotPath, args,
+ checked: checked);
}
// If the command has a path separator, then it's a path relative to the
@@ -95,8 +96,7 @@ Future<int> runExecutable(Entrypoint entrypoint, String package,
var vmArgs = [];
// Run in checked mode.
- // TODO(rnystrom): Make this configurable.
- vmArgs.add("--checked");
+ if (checked) vmArgs.add("--checked");
var executableUrl = await _executableUrl(
entrypoint, package, executable, isGlobal: isGlobal, mode: mode);
@@ -268,8 +268,8 @@ void _forwardSignals(Process process) {
/// Runs the executable snapshot at [snapshotPath].
Future<int> _runCachedExecutable(Entrypoint entrypoint, String snapshotPath,
- List<String> args) {
- return runSnapshot(snapshotPath, args, checked: true, recompile: () {
+ List<String> args, {bool checked}) {
nweiz 2015/08/06 00:08:28 ": false"
Bob Nystrom 2015/08/06 16:54:42 Done.
+ return runSnapshot(snapshotPath, args, checked: checked, recompile: () {
log.fine("Precompiled executable is out of date.");
return entrypoint.precompileExecutables();
});

Powered by Google App Engine
This is Rietveld 408576698