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

Side by Side Diff: sdk/lib/isolate/isolate.dart

Issue 1088433004: Add StackTrace.fromString constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/core/stacktrace.dart ('k') | tests/corelib/stacktrace_fromstring_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Concurrent programming using _isolates_: 6 * Concurrent programming using _isolates_:
7 * independent workers that are similar to threads 7 * independent workers that are similar to threads
8 * but don't share memory, 8 * but don't share memory,
9 * communicating only via messages. 9 * communicating only via messages.
10 */ 10 */
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 /** 365 /**
366 * Requests that uncaught errors of the isolate are sent back to [port]. 366 * Requests that uncaught errors of the isolate are sent back to [port].
367 * 367 *
368 * WARNING: This method is experimental and not handled on every platform yet. 368 * WARNING: This method is experimental and not handled on every platform yet.
369 * 369 *
370 * The errors are sent back as two elements lists. 370 * The errors are sent back as two elements lists.
371 * The first element is a `String` representation of the error, usually 371 * The first element is a `String` representation of the error, usually
372 * created by calling `toString` on the error. 372 * created by calling `toString` on the error.
373 * The second element is a `String` representation of an accompanying 373 * The second element is a `String` representation of an accompanying
374 * stack trace, or `null` if no stack trace was provided. 374 * stack trace, or `null` if no stack trace was provided.
375 * To convert this back to a [StackTrace] object, use [StackTrace.fromString].
375 * 376 *
376 * Listening using the same port more than once does nothing. It will only 377 * Listening using the same port more than once does nothing. It will only
377 * get each error once. 378 * get each error once.
378 */ 379 */
379 external void addErrorListener(SendPort port); 380 external void addErrorListener(SendPort port);
380 381
381 /** 382 /**
382 * Stop listening for uncaught errors through [port]. 383 * Stop listening for uncaught errors through [port].
383 * 384 *
384 * WARNING: This method is experimental and not handled on every platform yet. 385 * WARNING: This method is experimental and not handled on every platform yet.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 * Description of an error from another isolate. 601 * Description of an error from another isolate.
601 * 602 *
602 * This error has the same `toString()` and `stackTrace.toString()` behavior 603 * This error has the same `toString()` and `stackTrace.toString()` behavior
603 * as the original error, but has no other features of the original error. 604 * as the original error, but has no other features of the original error.
604 */ 605 */
605 class RemoteError implements Error { 606 class RemoteError implements Error {
606 final String _description; 607 final String _description;
607 final StackTrace stackTrace; 608 final StackTrace stackTrace;
608 RemoteError(String description, String stackDescription) 609 RemoteError(String description, String stackDescription)
609 : _description = description, 610 : _description = description,
610 stackTrace = new _RemoteStackTrace(stackDescription); 611 stackTrace = new StackTrace.fromString(stackDescription);
611 String toString() => _description; 612 String toString() => _description;
612 } 613 }
613
614 class _RemoteStackTrace implements StackTrace {
615 String _trace;
616 _RemoteStackTrace(this._trace);
617 String toString() => _trace;
618 }
OLDNEW
« no previous file with comments | « sdk/lib/core/stacktrace.dart ('k') | tests/corelib/stacktrace_fromstring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698