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

Unified Diff: lib/src/io.dart

Issue 948113004: Support Dart 1.8.0. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « lib/src/dart.dart ('k') | lib/src/isolate_wrapper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io.dart
diff --git a/lib/src/io.dart b/lib/src/io.dart
index fe69ab4dbb385759f1ef829755fdaf2bcf9e19ed..895fbdc4e25ac1813911ce9b6683751ef567935b 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -7,6 +7,18 @@ library unittest.io;
import 'dart:async';
import 'dart:io';
+import 'package:path/path.dart' as p;
+
+/// Returns whether the current Dart version supports [Isolate.kill].
+final bool supportsIsolateKill = _supportsIsolateKill;
+bool get _supportsIsolateKill {
+ // This isn't 100% accurate, since early 1.9 dev releases didn't support
+ // Isolate.kill(), but it's very unlikely anyone will be using them.
+ // TODO(nweiz): remove this when we no longer support older Dart versions.
+ var path = p.join(p.dirname(p.dirname(Platform.executable)), 'version');
+ return new File(path).readAsStringSync().startsWith('1.9');
+}
+
// TODO(nweiz): Make this check [stdioType] once that works within "pub run".
/// Whether "special" strings such as Unicode characters or color escapes are
/// safe to use.
« no previous file with comments | « lib/src/dart.dart ('k') | lib/src/isolate_wrapper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698