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

Unified Diff: sdk/lib/_internal/pub/lib/src/dart.dart

Issue 581283003: Get rid of Chain.track in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « sdk/lib/_internal/pub/lib/src/command/uploader.dart ('k') | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/dart.dart
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart
index 85035f2659a9a6f0304ea1e93b7ce990d9e9a27c..fae307e6ed2b12b97397cbf3dd2448df9a837f87 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -11,7 +11,6 @@ import 'dart:isolate';
import 'package:analyzer/analyzer.dart';
import 'package:path/path.dart' as path;
-import 'package:stack_trace/stack_trace.dart';
import '../../../compiler/compiler.dart' as compiler;
import '../../../compiler/implementation/filenames.dart'
@@ -21,7 +20,6 @@ import '../../asset/dart/serialize.dart';
import 'io.dart';
import 'log.dart' as log;
-import 'utils.dart';
/// Interface to communicate with dart2js.
///
/// This is basically an amalgamation of dart2js's
@@ -73,7 +71,7 @@ Future compile(String entrypoint, CompilerProvider provider, {
bool terse: false,
bool includeSourceMapUrls: false,
bool toDart: false}) {
- return syncFuture(() {
+ return new Future.sync(() {
var options = <String>['--categories=Client,Server'];
if (checked) options.add('--enable-checked-mode');
if (csp) options.add('--csp');
@@ -101,7 +99,7 @@ Future compile(String entrypoint, CompilerProvider provider, {
packageRoot = path.join(path.dirname(entrypoint), 'packages');
}
- return Chain.track(compiler.compile(
+ return compiler.compile(
path.toUri(entrypoint),
provider.libraryRoot,
path.toUri(appendSlash(packageRoot)),
@@ -109,7 +107,7 @@ Future compile(String entrypoint, CompilerProvider provider, {
provider.handleDiagnostic,
options,
provider.provideOutput,
- environment));
+ environment);
});
}
@@ -158,18 +156,18 @@ class _DirectiveCollector extends GeneralizingAstVisitor {
Future runInIsolate(String code, message, {String snapshot}) {
if (snapshot != null && fileExists(snapshot)) {
log.fine("Spawning isolate from $snapshot.");
- return Chain.track(Isolate.spawnUri(path.toUri(snapshot), [], message));
+ return Isolate.spawnUri(path.toUri(snapshot), [], message);
}
return withTempDir((dir) async {
var dartPath = path.join(dir, 'runInIsolate.dart');
writeTextFile(dartPath, code, dontLogContents: true);
var port = new ReceivePort();
- await Chain.track(Isolate.spawn(_isolateBuffer, {
+ await Isolate.spawn(_isolateBuffer, {
'replyTo': port.sendPort,
'uri': path.toUri(dartPath).toString(),
'message': message
- }));
+ });
var response = await port.first;
if (response['type'] == 'error') {
@@ -200,8 +198,7 @@ Future runInIsolate(String code, message, {String snapshot}) {
/// Adding an additional isolate in the middle works around this.
void _isolateBuffer(message) {
var replyTo = message['replyTo'];
- Chain.track(Isolate.spawnUri(
- Uri.parse(message['uri']), [], message['message']))
+ Isolate.spawnUri(Uri.parse(message['uri']), [], message['message'])
.then((_) => replyTo.send({'type': 'success'}))
.catchError((e, stack) {
replyTo.send({
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/uploader.dart ('k') | sdk/lib/_internal/pub/lib/src/entrypoint.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698