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

Side by Side Diff: sdk/lib/_internal/js_runtime/lib/async_patch.dart

Issue 1383213002: Make dart2js code retain the original stack trace for uncaught async errors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 // Patch file for the dart:async library. 5 // Patch file for the dart:async library.
6 6
7 import 'dart:_js_helper' show 7 import 'dart:_js_helper' show
8 patch, 8 patch,
9 ExceptionAndStackTrace, 9 ExceptionAndStackTrace,
10 Primitives, 10 Primitives,
11 convertDartClosureToJS, 11 convertDartClosureToJS,
12 getTraceFromException, 12 getTraceFromException,
13 requiresPreamble, 13 requiresPreamble,
14 wrapException,
14 unwrapException; 15 unwrapException;
15 import 'dart:_isolate_helper' show 16 import 'dart:_isolate_helper' show
16 IsolateNatives, 17 IsolateNatives,
17 TimerImpl, 18 TimerImpl,
18 leaveJsAsync, 19 leaveJsAsync,
19 enterJsAsync, 20 enterJsAsync,
20 isWorker; 21 isWorker;
21 22
22 import 'dart:_foreign_helper' show JS; 23 import 'dart:_foreign_helper' show JS;
23 24
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // Each invocation should give a body with fresh state. 503 // Each invocation should give a body with fresh state.
503 final dynamic /* js function */ _outerHelper; 504 final dynamic /* js function */ _outerHelper;
504 505
505 _SyncStarIterable(this._outerHelper); 506 _SyncStarIterable(this._outerHelper);
506 507
507 Iterator get iterator => new _SyncStarIterator(JS('', '#()', _outerHelper)); 508 Iterator get iterator => new _SyncStarIterator(JS('', '#()', _outerHelper));
508 } 509 }
509 510
510 @patch 511 @patch
511 void _rethrow(Object error, StackTrace stackTrace) { 512 void _rethrow(Object error, StackTrace stackTrace) {
512 throw new AsyncError(error, stackTrace); 513 error = wrapException(error);
514 JS("void", "#.stack = #", error, stackTrace.toString());
Siggi Cherem (dart-lang) 2015/10/05 17:09:33 I'm not super familiar with this logic yet, but I
Lasse Reichstein Nielsen 2015/10/06 07:57:26 As I understand it, the "generally accepted" behav
515 JS("void", "throw #", error);
513 } 516 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698