Skip to content

Commit

Permalink
Removed unsound null safety options from classes ModuleMetadata, Meta…
Browse files Browse the repository at this point in the history
…dataProvider & Metadata_test.
  • Loading branch information
jyameo committed Oct 8, 2024
1 parent aae09ef commit ee10f9b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dwds/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- Replace deprecated JS code `this.__proto__` with `Object.getPrototypeOf(this)`. - [#2500](https://github.com/dart-lang/webdev/pull/2500)
- Migrate injected client code to `package:web`. - [#2491](https://github.com/dart-lang/webdev/pull/2491)
- Removed unsound null safety options from classes ModuleMetadata and MetadataProvider - [#2427](https://github.com/dart-lang/webdev/issues/2427)
- Removed unsound null safety options from classes ModuleMetadata, MetadataProvider & Metadata_test. - [#2427](https://github.com/dart-lang/webdev/issues/2427)

## 24.1.0

Expand Down
10 changes: 1 addition & 9 deletions dwds/lib/src/debugging/metadata/module_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,13 @@ class ModuleMetadata {
/// Module uri
final String moduleUri;

// Keep the soundNullSafety flag for backward compatibility
@Deprecated('This field is deprecated as sound null safety is enforced.')
final bool soundNullSafety;

final Map<String, LibraryMetadata> libraries = {};

ModuleMetadata(
this.name,
this.closureName,
this.sourceMapUri,
this.moduleUri, {
this.soundNullSafety = true, // Default to true
String? ver,
}) {
version = ver ?? ModuleMetadataVersion.current.version;
Expand All @@ -151,10 +146,7 @@ class ModuleMetadata {
name = _readRequiredField(json, 'name'),
closureName = _readRequiredField(json, 'closureName'),
sourceMapUri = _readRequiredField(json, 'sourceMapUri'),
moduleUri = _readRequiredField(json, 'moduleUri'),
// Deprecated field still present for backward compatibility
// Defaults to true if missing
soundNullSafety = _readOptionalField(json, 'soundNullSafety') ?? true {
moduleUri = _readRequiredField(json, 'moduleUri') {
if (!ModuleMetadataVersion.current.isCompatibleWith(version) &&
!ModuleMetadataVersion.previous.isCompatibleWith(version)) {
throw Exception('Unsupported metadata version $version. '
Expand Down
4 changes: 1 addition & 3 deletions dwds/lib/src/debugging/metadata/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class MetadataProvider {
final AssetReader _assetReader;
final _logger = Logger('MetadataProvider');
final String entrypoint;
@Deprecated('This field is deprecated as sound null safety is enforced.')
final bool _soundNullSafety = true;
final List<String> _libraries = [];
final Map<String, String> _scriptToModule = {};
final Map<String, String> _moduleToSourceMap = {};
Expand Down Expand Up @@ -73,7 +71,7 @@ class MetadataProvider {
/// All libraries have to agree on null safety mode.
Future<bool> get soundNullSafety async {
await _initialize();
return _soundNullSafety;
return true;
}

/// A list of all libraries in the Dart application.
Expand Down
1 change: 0 additions & 1 deletion dwds/test/metadata_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,5 @@ void main() {
expect(parts.length, 1);
expect(parts[0], 'org-dartlang-app:///web/main.dart');
}
expect(metadata.soundNullSafety, true);
});
}

0 comments on commit ee10f9b

Please sign in to comment.