Skip to content

Commit 072aaae

Browse files
committed
Issue 25101. Flush TOKEN_STREAM after computing PARSED_UNIT.
[email protected] BUG= #25101 Review URL: https://codereview.chromium.org/1495783005 .
1 parent 94fcce2 commit 072aaae

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pkg/analyzer/lib/src/task/dart.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,13 +3488,13 @@ class ParseDartTask extends SourceBasedAnalysisTask {
34883488
/**
34893489
* Return a map from the names of the inputs of this kind of task to the task
34903490
* input descriptors describing those inputs for a task with the given
3491-
* [source].
3491+
* [target].
34923492
*/
34933493
static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
34943494
return <String, TaskInput>{
34953495
LINE_INFO_INPUT_NAME: LINE_INFO.of(target),
34963496
MODIFICATION_TIME_INPUT_NAME: MODIFICATION_TIME.of(target),
3497-
TOKEN_STREAM_INPUT_NAME: TOKEN_STREAM.of(target)
3497+
TOKEN_STREAM_INPUT_NAME: TOKEN_STREAM.of(target, flushOnAccess: true)
34983498
};
34993499
}
35003500

pkg/analyzer/test/src/task/dart_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,6 +2913,13 @@ part 'test.dart';
29132913
expect(outputs[UNITS], hasLength(1));
29142914
}
29152915

2916+
test_perform_flushTokenStream() {
2917+
_performParseTask(r'''
2918+
class Test {}
2919+
''');
2920+
expect(analysisCache.getState(source, TOKEN_STREAM), CacheState.FLUSHED);
2921+
}
2922+
29162923
test_perform_invalidDirectives() {
29172924
_performParseTask(r'''
29182925
library lib;

0 commit comments

Comments
 (0)