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

Unified Diff: tools/dom/src/native_DOMImplementation.dart

Issue 14113032: Add helper for parsing stack traces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/native_DOMImplementation.dart
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index b5b265004120bc9988e895ad2f36412ac168b106..9b1233bab4a4dc3c398841f68dd9517895f23d59 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -43,6 +43,15 @@ class _Utils {
return result;
}
+ static List parseStackTrace(StackTrace stackTrace) {
Anton Muhin 2013/04/29 07:55:53 regexp woodoo looks a bit hacky, maybe ask VM team
podivilov 2013/04/29 08:29:09 There's currently no public API in StackTrace. VM
+ final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)');
+ List result = [];
+ for (var match in regExp.allMatches(stackTrace.toString())) {
+ result.add([match.group(1), match.group(2), int.parse(match.group(3)), int.parse(match.group(4))]);
+ }
+ return result;
+ }
+
static void populateMap(Map result, List list) {
for (int i = 0; i < list.length; i += 2) {
result[list[i]] = list[i + 1];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698