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

Side by Side Diff: lib/src/runner/vm/catch_isolate_errors.dart

Issue 1685363002: Add a platform plugin infrastructure. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:isolate';
6 import 'dart:async';
7
8 import 'package:stack_trace/stack_trace.dart';
9
10 import '../../backend/declarer.dart';
kevmoo 2016/02/11 19:57:50 All of these seem to be unused imports...
nweiz 2016/02/11 21:29:18 Done.
11 import '../../backend/group.dart';
12 import '../../backend/live_test.dart';
13 import '../../backend/metadata.dart';
14 import '../../backend/suite.dart';
15 import '../../backend/test.dart';
16 import '../../backend/test_platform.dart';
17 import '../../util/io.dart';
18 import '../../util/remote_exception.dart';
19 import '../../utils.dart';
20
21 /// Capture any top-level errors (mostly lazy syntax errors, since other are
22 /// caught below) and report them to the parent isolate.
23 void catchIsolateErrors() {
24 var errorPort = new ReceivePort();
25 // Aet errors non-fatal because otherwise they'll be double-printed.
26 Isolate.current.setErrorsFatal(false);
27 Isolate.current.addErrorListener(errorPort.sendPort);
28 errorPort.listen((message) {
29 // Masquerade as an IsoalteSpawnException because that's what this would
30 // be if the error had been detected statically.
31 var error = new IsolateSpawnException(message[0]);
32 var stackTrace =
33 message[1] == null ? new Trace([]) : new Trace.parse(message[1]);
34 Zone.current.handleUncaughtError(error, stackTrace);
35 });
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698