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

Unified Diff: runtime/tests/vm/dart/isolate_unhandled_exception_uri_helper.dart

Issue 11558034: Second version of support for specifying an unhandled exception callback (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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: runtime/tests/vm/dart/isolate_unhandled_exception_uri_helper.dart
===================================================================
--- runtime/tests/vm/dart/isolate_unhandled_exception_uri_helper.dart (revision 0)
+++ runtime/tests/vm/dart/isolate_unhandled_exception_uri_helper.dart (revision 0)
@@ -0,0 +1,22 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:isolate';
+
+// Isolate script that throws an uncaught exception, which is caught by an
+// uncaught exception handler.
+
+void main() {
+ port.receive((message, replyTo) {
+ if (message == 'throw exception') {
+ throw new RuntimeError('ignore this exception');
+ }
+ replyTo.call('hello');
+ port.close();
+ });
+}
+
+bool _unhandledExceptionCallback(IsolateUnhandledException e) {
+ return e.source.message == 'ignore this exception';
+}

Powered by Google App Engine
This is Rietveld 408576698