@@ -32,6 +32,7 @@ import '../compiler.dart' show defaultRuntimeFiles;
32
32
import '../info.dart' ;
33
33
import '../options.dart' ;
34
34
import '../report.dart' ;
35
+ import '../report/html_reporter.dart' ;
35
36
36
37
/// Holds references to all source nodes in the import graph. This is mainly
37
38
/// used as a level of indirection to ensure that each source has a canonical
@@ -146,6 +147,8 @@ abstract class SourceNode {
146
147
}
147
148
}
148
149
150
+ void clearSummary () {}
151
+
149
152
void saveUpdatedContents () {}
150
153
151
154
String toString () {
@@ -183,14 +186,20 @@ class HtmlSourceNode extends SourceNode {
183
186
: runtimeDeps = graph.runtimeDeps,
184
187
super (graph, uri, source);
185
188
189
+ @override
190
+ void clearSummary () {
191
+ var reporter = graph._reporter;
192
+ if (reporter is HtmlReporter ) {
193
+ reporter.reporter.clearHtml (uri);
194
+ } else if (reporter is SummaryReporter ) {
195
+ reporter.clearHtml (uri);
196
+ }
197
+ }
198
+
186
199
@override
187
200
void update () {
188
201
super .update ();
189
202
if (needsRebuild) {
190
- var reporter = graph._reporter;
191
- if (reporter is SummaryReporter ) {
192
- reporter.clearHtml (uri);
193
- }
194
203
document = html.parse (contents, generateSpans: true );
195
204
var newScripts = new Set <DartSourceNode >();
196
205
var tags = document.querySelectorAll ('script[type="application/dart"]' );
@@ -290,16 +299,21 @@ class DartSourceNode extends SourceNode {
290
299
graph._context.setContents (_source, _source.contents.data);
291
300
}
292
301
302
+ @override
303
+ void clearSummary () {
304
+ var reporter = graph._reporter;
305
+ if (reporter is HtmlReporter ) {
306
+ reporter.reporter.clearLibrary (uri);
307
+ } else if (reporter is SummaryReporter ) {
308
+ reporter.clearLibrary (uri);
309
+ }
310
+ }
311
+
293
312
@override
294
313
void update () {
295
314
super .update ();
296
315
297
316
if (needsRebuild) {
298
- var reporter = graph._reporter;
299
- if (reporter is SummaryReporter ) {
300
- reporter.clearLibrary (uri);
301
- }
302
-
303
317
// If the defining compilation-unit changed, the structure might have
304
318
// changed.
305
319
var unit = parseDirectives (contents, name: _source.fullName);
0 commit comments