Skip to content

Commit 0f7b674

Browse files
nateboschcommit-bot@chromium.org
authored andcommitted
Invalidate DDC library cache on trackLibraries
Since we cache everything on the first call to `_computeLibraryMetadata`, if we haven't called `trackLibraries` for some module before the first time we fetch libraries then it will never be available. Change-Id: If0c8d5835fb95e244797631d6452bd154eec30e5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120936 Reviewed-by: Vijay Menon <vsm@google.com> Commit-Queue: Nate Bosch <nbosch@google.com>
1 parent 94e312f commit 0f7b674

File tree

2 files changed

+6
-0
lines changed
  • sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime
  • sdk/lib/_internal/js_dev_runtime/private/ddc_runtime

2 files changed

+6
-0
lines changed

sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ void trackLibraries(
152152
JS('', '#.set(#, #)', _loadedSourceMaps, moduleName, sourceMap);
153153
JS('', '#.set(#, #)', _loadedModules, moduleName, libraries);
154154
JS('', '#.set(#, #)', _loadedPartMaps, moduleName, parts);
155+
_libraries = null;
156+
_libraryObjects = null;
157+
_parts = null;
155158
}
156159

157160
List<String> _libraries;

sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/rtti.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ void trackLibraries(
154154
JS('', '#.set(#, #)', _loadedSourceMaps, moduleName, sourceMap);
155155
JS('', '#.set(#, #)', _loadedModules, moduleName, libraries);
156156
JS('', '#.set(#, #)', _loadedPartMaps, moduleName, parts);
157+
_libraries = null;
158+
_libraryObjects = null;
159+
_parts = null;
157160
}
158161

159162
List<String> _libraries;

0 commit comments

Comments
 (0)