Chromium Code Reviews| Index: lib/src/isolate.dart |
| diff --git a/lib/src/isolate.dart b/lib/src/isolate.dart |
| index 03efd5d7dd8cfc9b2d880647a963cfeda917cf42..9f04ff2018426ff12b595fe8762fba5e1ed3ed04 100644 |
| --- a/lib/src/isolate.dart |
| +++ b/lib/src/isolate.dart |
| @@ -16,6 +16,7 @@ import 'library.dart'; |
| import 'pause_event.dart'; |
| import 'scope.dart'; |
| import 'sentinel.dart'; |
| +import 'source_report.dart'; |
| import 'stack.dart'; |
| import 'stream_manager.dart'; |
| import 'utils.dart'; |
| @@ -343,6 +344,47 @@ class VMIsolateRef { |
| return _scope.sendRequest(method, params); |
| } |
| + /// Generates a report of code coverage information and possible break points |
| + /// for the scripts in this isolate. |
| + /// |
| + /// If [includeCoverageReport] is `true`, the report includes code coverage |
| + /// information via [VMSourceReportRange.hits] and |
| + /// [VMSourceReportRange.misses] in |
| + /// [VMSourceReport.ranges]. |
| + /// Otherwise, [VMSourceReportRange.coverage] is `null`. |
|
nweiz
2016/05/04 23:05:51
Reflow this text so there isn't unnecessary whites
kevmoo
2016/05/05 20:46:26
Done – mostly.
I like to start new sentences on n
nweiz
2016/05/11 23:03:31
That's contrary to the style elsewhere in this pac
kevmoo
2016/05/12 05:22:34
Markdown ignores single-line breaks – so no humans
|
| + /// |
| + /// If [includePossibleBreakpoints] is `true`, the report includes a list of |
| + /// token positions which correspond to possible breakpoints via |
| + /// [VMSourceReportRange.possibleBreakpoints] in [VMSourceReport.ranges]. |
| + /// Otherwise, [VMSourceReportRange.possibleBreakpoints] is `null`. |
| + /// |
| + /// If [forceCompile] is `true`, all functions in the range of the report |
| + /// will be compiled. If `false`, functions that are never used may not appear |
| + /// in [VMSourceReportRange.misses]. |
| + /// Forcing compilation can cause a compilation error, which could terminate |
| + /// the running Dart program. |
| + Future<VMSourceReport> getSourceReport( |
| + {bool includeCoverageReport: false, |
| + bool includePossibleBreakpoints: false, |
|
nweiz
2016/05/04 23:05:51
It doesn't seem particularly useful to have the so
kevmoo
2016/05/05 20:46:26
Done.
|
| + bool forceCompile: false}) async { |
| + var reports = <String>[]; |
| + if (includeCoverageReport) { |
| + reports.add('Coverage'); |
| + } |
| + |
| + if (includePossibleBreakpoints) { |
| + reports.add('PossibleBreakpoints'); |
| + } |
| + |
| + var params = {'reports': reports}; |
| + if (forceCompile) { |
| + params['forceCompile'] = true; |
| + } |
|
nweiz
2016/05/04 23:05:51
Good thing you tested this! :D
kevmoo
2016/05/05 20:46:26
Acknowledged.
|
| + |
| + var json = await _scope.sendRequest('getSourceReport', params); |
| + return newSourceReport(_scope, json); |
| + } |
| + |
| bool operator ==(other) => other is VMIsolateRef && |
| other._scope.isolateId == _scope.isolateId; |