anchor.diff:          diagnosticHandler: resilientDiagnosticHandler,
           outputProvider: outputProvider);
   
  -    if (!await compiler.compile(originalInput)) {
  -      print("Compilation failed");
  +    bool success = await compiler.compile(originalInput);
  +    sw.stop();
  +    if (success) {
  +      controller.add(
  +          new CompilerEvent(
  +              IncrementalKind.FULL, compiler, outputProvider.output, sw));
       } else {
  -      print('// Compiled JavaScript:');
  -      print(outputProvider['.js']);
  +      controller.add(
  +          new CompilerEvent(
  +              IncrementalKind.ERROR, compiler, outputProvider.output, sw));
       }
   
  -    int updateCount = 0;
       while (await watcher.hasChanges()) {
         try {
           Map<Uri, Uri> changes = watcher.readChanges();
   
  -        Stopwatch sw = new Stopwatch()..start();
  +        sw = new Stopwatch()..start();
           await compiler.compileUpdates(changes);
  +        sw.stop();
   
  -        String updates = '${compiler.allUpdates()}';
  +        controller.add(
  +            new CompilerEvent(
  +                IncrementalKind.INCREMENTAL, compiler, outputProvider.output,
  +                sw));
   
  -        sw.stop();
  -        print('// Patch after ${++updateCount} updates,');
  -        print('// computed in ${sw.elapsedMicroseconds/1000000} seconds:');
  -        print(updates);
  -      } on IncrementalCompilationFailed catch (error) {
  -        print("Incremental compilation failed due to:\n${error.reason}");
  +      } on IncrementalCompilationFailed catch (error, trace) {
  +        controller.addError(error, trace);
           break;
         }
       }
  
positive.code: import 'dart:io';
  
  import 'dart:async' show
      StreamSubscription,
      EventSink,
      Future;
  
  import 'package:dart2js_incremental/dart2js_incremental.dart' show
      IncrementalCompilationFailed,
  
negative.code: 
  import 'watcher.dart';
  
  main(List<String> arguments) {
    int updateCount = 0;
    StreamSubscription<CompilerEvent> subscription =
        compile(Uri.base.resolve(arguments.first)).listen(null);
    subscription.onData((CompilerEvent event) {
      switch (event.kind) {
        case IncrementalKind.FULL:
          updateCount = 0;
          print('// Compiled JavaScript:');
          print(event['.js']);
          break;
  
        case IncrementalKind.INCREMENTAL:
          Stopwatch sw = event.stopwatch..start();
          String updates = '${event.compiler.allUpdates()}';
          sw.stop();
  
          print('// Patch after ${++updateCount} updates,');
          print('// computed in ${sw.elapsedMicroseconds/1000000} seconds:');
          print(updates);
          break;
  
        case IncrementalKind.ERROR:
          updateCount = 0;
          print("Compilation failed");
          break;
  
        default:
          throw "Unknown kind: ${event.kind}";
      }
    });
    subscription.onError((error, StackTrace trace) {
      if (error is IncrementalCompilationFailed) {
        print("Incremental compilation failed due to:\n${error.reason}");
      } else {
        throw error;
      }
    });
  }
  
  Stream<CompilerEvent> compile(Uri originalInput) {
    StreamController<CompilerEvent> controller =
        new StreamController<CompilerEvent>();
    compileToStream(originalInput, controller);
    return controller.stream;
  }
  
  compileToStream(
      Uri originalInput,
      StreamController<CompilerEvent> controller) async {
    var watcher = new Watcher();
  
    Uri libraryRoot = Uri.base.resolve('sdk/');
  