| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |