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

Side by Side Diff: bin/inference/client.dart

Issue 2233093003: make dart2js_info strong-mode clean (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Client component to display [GlobalResult]s as a web app. 5 /// Client component to display [GlobalResult]s as a web app.
6 library dart2js_info.bin.inference.client; 6 library dart2js_info.bin.inference.client;
7 7
8 import 'dart:html' hide Entry; 8 import 'dart:html' hide Entry;
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'package:dart2js_info/info.dart'; 10 import 'package:dart2js_info/info.dart';
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } else if (contents.codeUnitAt(i) == $gt) { 109 } else if (contents.codeUnitAt(i) == $gt) {
110 code.replace(i, i + 1, '>'); 110 code.replace(i, i + 1, '>');
111 } else if (contents.codeUnitAt(i) == $lf) { 111 } else if (contents.codeUnitAt(i) == $lf) {
112 code.insert(i + 1, '</span><span class="line">'); 112 code.insert(i + 1, '</span><span class="line">');
113 } 113 }
114 } 114 }
115 code.insert(contents.length, '</span>'); 115 code.insert(contents.length, '</span>');
116 } 116 }
117 117
118 @override 118 @override
119 visitFunction(FunctionInfo function) { 119 Null visitFunction(FunctionInfo function) {
120 if (function.measurements?.uri?.path != path) return; 120 if (function.measurements?.uri?.path != path) return null;
121 var entries = function.measurements.entries; 121 var entries = function.measurements.entries;
122 for (var metric in entries.keys) { 122 for (var metric in entries.keys) {
123 if (metric is GroupedMetric) continue; 123 if (metric is GroupedMetric) continue;
124 var cssClassName = _classNameForMetric(metric); 124 var cssClassName = _classNameForMetric(metric);
125 for (var entry in entries[metric]) { 125 for (var entry in entries[metric]) {
126 code.insert(entry.begin, '<span class="send ${cssClassName} inactive">', 126 code.insert(entry.begin, '<span class="send ${cssClassName} inactive">',
127 -entry.end); 127 -entry.end);
128 code.insert(entry.end, '</span>'); 128 code.insert(entry.end, '</span>');
129 } 129 }
130 } 130 }
131 return null;
131 } 132 }
132 } 133 }
133 134
134 _classNameForMetric(Metric metric) => metric.name.replaceAll(' ', '-'); 135 _classNameForMetric(Metric metric) => metric.name.replaceAll(' ', '-');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698