Chromium Code Reviews| 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 // Patch file for dart:core classes. | 5 // Patch file for dart:core classes. |
| 6 import "dart:_internal" as _symbol_dev; | 6 import "dart:_internal" as _symbol_dev; |
| 7 import 'dart:_interceptors'; | 7 import 'dart:_interceptors'; |
| 8 import 'dart:_js_helper' show patch, | 8 import 'dart:_js_helper' show patch, |
| 9 checkInt, | 9 checkInt, |
| 10 getRuntimeType, | 10 getRuntimeType, |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 @patch | 445 @patch |
| 446 static bool get _isWindows => false; | 446 static bool get _isWindows => false; |
| 447 | 447 |
| 448 @patch | 448 @patch |
| 449 static Uri get base { | 449 static Uri get base { |
| 450 String uri = Primitives.currentUri(); | 450 String uri = Primitives.currentUri(); |
| 451 if (uri != null) return Uri.parse(uri); | 451 if (uri != null) return Uri.parse(uri); |
| 452 throw new UnsupportedError("'Uri.base' is not supported"); | 452 throw new UnsupportedError("'Uri.base' is not supported"); |
| 453 } | 453 } |
| 454 } | 454 } |
| 455 | |
| 456 @patch | |
| 457 class StackTrace { | |
| 458 @patch | |
| 459 @NoInline() | |
|
Jennifer Messerly
2016/02/19 22:23:56
I think I've been removing these, they're meaningl
| |
| 460 static StackTrace get current { | |
| 461 var error = JS('', 'new Error()'); | |
| 462 var stack = JS('String|Null', '#.stack', error); | |
| 463 if (stack is String) return new StackTrace.fromString(stack); | |
| 464 if (JS('', 'Error.captureStackTrace') != null) { | |
| 465 JS('void', 'Error.captureStackTrace(#)', error); | |
| 466 var stack = JS('String|Null', '#.stack', error); | |
| 467 if (stack is String) return new StackTrace.fromString(stack); | |
| 468 } | |
| 469 try { | |
| 470 throw 0; | |
| 471 } catch (_, stackTrace) { | |
| 472 return stackTrace; | |
| 473 } | |
| 474 } | |
| 475 } | |
| OLD | NEW |