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

Side by Side 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, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 part of html; 5 part of html;
6 6
7 class _Utils { 7 class _Utils {
8 static double dateTimeToDouble(DateTime dateTime) => 8 static double dateTimeToDouble(DateTime dateTime) =>
9 dateTime.millisecondsSinceEpoch.toDouble(); 9 dateTime.millisecondsSinceEpoch.toDouble();
10 static DateTime doubleToDateTime(double dateTime) { 10 static DateTime doubleToDateTime(double dateTime) {
(...skipping 25 matching lines...) Expand all
36 if (map['alpha'] == true) result |= 0x01; 36 if (map['alpha'] == true) result |= 0x01;
37 if (map['depth'] == true) result |= 0x02; 37 if (map['depth'] == true) result |= 0x02;
38 if (map['stencil'] == true) result |= 0x4; 38 if (map['stencil'] == true) result |= 0x4;
39 if (map['antialias'] == true) result |= 0x08; 39 if (map['antialias'] == true) result |= 0x08;
40 if (map['premultipliedAlpha'] == true) result |= 0x10; 40 if (map['premultipliedAlpha'] == true) result |= 0x10;
41 if (map['preserveDrawingBuffer'] == true) result |= 0x20; 41 if (map['preserveDrawingBuffer'] == true) result |= 0x20;
42 42
43 return result; 43 return result;
44 } 44 }
45 45
46 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
47 final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)');
48 List result = [];
49 for (var match in regExp.allMatches(stackTrace.toString())) {
50 result.add([match.group(1), match.group(2), int.parse(match.group(3)), int .parse(match.group(4))]);
51 }
52 return result;
53 }
54
46 static void populateMap(Map result, List list) { 55 static void populateMap(Map result, List list) {
47 for (int i = 0; i < list.length; i += 2) { 56 for (int i = 0; i < list.length; i += 2) {
48 result[list[i]] = list[i + 1]; 57 result[list[i]] = list[i + 1];
49 } 58 }
50 } 59 }
51 60
52 static bool isMap(obj) => obj is Map; 61 static bool isMap(obj) => obj is Map;
53 62
54 static Map createMap() => {}; 63 static Map createMap() => {};
55 64
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 249 }
241 250
242 _send(msg) { 251 _send(msg) {
243 _sendToHelperIsolate(msg, _sendPort); 252 _sendToHelperIsolate(msg, _sendPort);
244 } 253 }
245 } 254 }
246 255
247 get _pureIsolateTimerFactoryClosure => 256 get _pureIsolateTimerFactoryClosure =>
248 ((int milliSeconds, void callback(Timer time), bool repeating) => 257 ((int milliSeconds, void callback(Timer time), bool repeating) =>
249 new _PureIsolateTimer(milliSeconds, callback, repeating)); 258 new _PureIsolateTimer(milliSeconds, callback, repeating));
OLDNEW
« 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