Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 library frame; | 5 library frame; |
| 6 | 6 |
| 7 | 7 |
| 8 import 'package:path/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
| 9 | 9 |
| 10 import 'trace.dart'; | 10 import 'trace.dart'; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 var match = _vmFrame.firstMatch(frame); | 107 var match = _vmFrame.firstMatch(frame); |
| 108 if (match == null) { | 108 if (match == null) { |
| 109 throw new FormatException("Couldn't parse VM stack trace line '$frame'."); | 109 throw new FormatException("Couldn't parse VM stack trace line '$frame'."); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Get the pieces out of the regexp match. Function, URI and line should | 112 // Get the pieces out of the regexp match. Function, URI and line should |
| 113 // always be found. The column is optional. | 113 // always be found. The column is optional. |
| 114 var member = match[1].replaceAll("<anonymous closure>", "<fn>"); | 114 var member = match[1].replaceAll("<anonymous closure>", "<fn>"); |
| 115 var uri = Uri.parse(match[2]); | 115 var uri = Uri.parse(match[2]); |
| 116 var line = int.parse(match[3]); | 116 var line = int.parse(match[3]); |
| 117 var col = null; | 117 var column = null; |
| 118 var col_match = match[4]; | 118 var columnMatch = match[4]; |
| 119 if (col_match != null) { | 119 if (columnMatch != null) { |
| 120 col = int.parse(col_match); | 120 col = int.parse(columnMatch); |
|
nweiz
2013/09/24 21:45:32
This still refers to "col", as does the reference
| |
| 121 } | 121 } |
| 122 return new Frame(uri, line, col, member); | 122 return new Frame(uri, line, col, member); |
| 123 } | 123 } |
| 124 | 124 |
| 125 /// Parses a string representation of a Chrome/V8 stack frame. | 125 /// Parses a string representation of a Chrome/V8 stack frame. |
| 126 factory Frame.parseV8(String frame) { | 126 factory Frame.parseV8(String frame) { |
| 127 var match = _v8Frame.firstMatch(frame); | 127 var match = _v8Frame.firstMatch(frame); |
| 128 if (match == null) { | 128 if (match == null) { |
| 129 throw new FormatException("Couldn't parse V8 stack trace line '$frame'."); | 129 throw new FormatException("Couldn't parse V8 stack trace line '$frame'."); |
| 130 } | 130 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 | 193 |
| 194 var line = match[2] == null ? null : int.parse(match[2]); | 194 var line = match[2] == null ? null : int.parse(match[2]); |
| 195 var column = match[3] == null ? null : int.parse(match[3]); | 195 var column = match[3] == null ? null : int.parse(match[3]); |
| 196 return new Frame(uri, line, column, match[4]); | 196 return new Frame(uri, line, column, match[4]); |
| 197 } | 197 } |
| 198 | 198 |
| 199 Frame(this.uri, this.line, this.column, this.member); | 199 Frame(this.uri, this.line, this.column, this.member); |
| 200 | 200 |
| 201 String toString() => '$location in $member'; | 201 String toString() => '$location in $member'; |
| 202 } | 202 } |
| OLD | NEW |