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

Side by Side Diff: tool/input_sdk/patch/core_patch.dart

Issue 1720473002: Support StackTrace.current (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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 | « tool/input_sdk/lib/core/stacktrace.dart ('k') | tool/sdk_expected_errors.txt » ('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 // 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
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 }
OLDNEW
« no previous file with comments | « tool/input_sdk/lib/core/stacktrace.dart ('k') | tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698