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

Side by Side Diff: frog/leg/lib/js_helper.dart

Issue 9601014: Support for stack traces in catch blocks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « no previous file | frog/leg/ssa/builder.dart » ('j') | frog/leg/ssa/builder.dart » ('J')
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 #library('js_helper'); 5 #library('js_helper');
6 6
7 #import('coreimpl.dart'); 7 #import('coreimpl.dart');
8 8
9 #source('date_helper.dart'); 9 #source('date_helper.dart');
10 #source('regexp_helper.dart'); 10 #source('regexp_helper.dart');
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 } 1296 }
1297 } 1297 }
1298 } else if (JS('bool', @'$0 instanceof RangeError', ex)) { 1298 } else if (JS('bool', @'$0 instanceof RangeError', ex)) {
1299 var message = JS('String', @'$0.message', ex); 1299 var message = JS('String', @'$0.message', ex);
1300 if (message.contains('call stack')) { 1300 if (message.contains('call stack')) {
1301 return new StackOverflowException(); 1301 return new StackOverflowException();
1302 } 1302 }
1303 } 1303 }
1304 return ex; 1304 return ex;
1305 } 1305 }
1306
1307 class StackTrace {
1308 var stack;
1309 StackTrace(this.stack);
1310 String toString() => stack != null ? stack : '';
1311 }
1312
1313 /**
1314 * Called by generated code to fetch the stack trace from an
1315 * exception.
1316 */
1317 StackTrace getTraceFromException(exception) {
1318 return new StackTrace(JS("var", @"$0.stack", exception));
1319 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/ssa/builder.dart » ('j') | frog/leg/ssa/builder.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698