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

Side by Side Diff: lib/src/utils.dart

Issue 2067063002: Trace.current skips an extra frame in JS. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 4 years, 6 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 | « lib/src/trace.dart ('k') | pubspec.yaml » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'package:path/path.dart' as p;
6
5 /// The line used in the string representation of stack chains to represent 7 /// The line used in the string representation of stack chains to represent
6 /// the gap between traces. 8 /// the gap between traces.
7 const chainGap = '===== asynchronous gap ===========================\n'; 9 const chainGap = '===== asynchronous gap ===========================\n';
8 10
11 // TODO(nweiz): When cross-platform imports work, use them to set this.
12 /// Whether we're running in a JS context.
13 final bool inJS = p.style == p.Style.url;
kevmoo 2016/06/14 22:35:13 Could this cause problems for VM files loaded via
nweiz 2016/06/14 22:54:56 The URL that Dart code is loaded from doesn't affe
14
9 /// Returns [string] with enough spaces added to the end to make it [length] 15 /// Returns [string] with enough spaces added to the end to make it [length]
10 /// characters long. 16 /// characters long.
11 String padRight(String string, int length) { 17 String padRight(String string, int length) {
12 if (string.length >= length) return string; 18 if (string.length >= length) return string;
13 19
14 var result = new StringBuffer(); 20 var result = new StringBuffer();
15 result.write(string); 21 result.write(string);
16 for (var i = 0; i < length - string.length; i++) { 22 for (var i = 0; i < length - string.length; i++) {
17 result.write(' '); 23 result.write(' ');
18 } 24 }
19 25
20 return result.toString(); 26 return result.toString();
21 } 27 }
OLDNEW
« no previous file with comments | « lib/src/trace.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698