Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 _ConsoleVariables { | 7 class _ConsoleVariables { |
| 8 Map<String, Object> _data = new Map<String, Object>(); | 8 Map<String, Object> _data = new Map<String, Object>(); |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 static List parseStackTrace(StackTrace stackTrace) { | 73 static List parseStackTrace(StackTrace stackTrace) { |
| 74 final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)'); | 74 final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)'); |
| 75 List result = []; | 75 List result = []; |
| 76 for (var match in regExp.allMatches(stackTrace.toString())) { | 76 for (var match in regExp.allMatches(stackTrace.toString())) { |
| 77 result.add([match.group(1), match.group(2), int.parse(match.group(3)), int .parse(match.group(4))]); | 77 result.add([match.group(1), match.group(2), int.parse(match.group(3)), int .parse(match.group(4))]); |
| 78 } | 78 } |
| 79 return result; | 79 return result; |
| 80 } | 80 } |
| 81 | 81 |
| 82 static List captureParsedStackTrace() { | |
| 83 try { | |
| 84 // Throwing an exception is the only way to generate a stack trace. | |
|
vsm
2013/10/22 00:32:59
Is there a bug to file for this?
Jacob
2013/10/22 00:45:37
https://code.google.com/p/dart/issues/detail?id=25
| |
| 85 throw new Exception(); | |
| 86 } catch (e, stackTrace) { | |
| 87 return parseStackTrace(stackTrace); | |
| 88 } | |
| 89 } | |
| 90 | |
| 82 static void populateMap(Map result, List list) { | 91 static void populateMap(Map result, List list) { |
| 83 for (int i = 0; i < list.length; i += 2) { | 92 for (int i = 0; i < list.length; i += 2) { |
| 84 result[list[i]] = list[i + 1]; | 93 result[list[i]] = list[i + 1]; |
| 85 } | 94 } |
| 86 } | 95 } |
| 87 | 96 |
| 88 static bool isMap(obj) => obj is Map; | 97 static bool isMap(obj) => obj is Map; |
| 89 | 98 |
| 90 static List toListIfIterable(obj) => obj is Iterable ? obj.toList() : null; | 99 static List toListIfIterable(obj) => obj is Iterable ? obj.toList() : null; |
| 91 | 100 |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 _scheduleImmediateHelper._schedule(callback); | 581 _scheduleImmediateHelper._schedule(callback); |
| 573 }; | 582 }; |
| 574 | 583 |
| 575 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 584 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
| 576 throw new UnimplementedError("scheduleMicrotask in background isolates " | 585 throw new UnimplementedError("scheduleMicrotask in background isolates " |
| 577 "are not supported in the browser")); | 586 "are not supported in the browser")); |
| 578 | 587 |
| 579 void _initializeCustomElement(Element e) { | 588 void _initializeCustomElement(Element e) { |
| 580 _Utils.initializeCustomElement(e); | 589 _Utils.initializeCustomElement(e); |
| 581 } | 590 } |
| OLD | NEW |