default to unsound nullability for web (#70120)

This commit is contained in:
Yegor 2020-11-09 13:49:02 -08:00 committed by GitHub
parent f1cdf2e6f3
commit 879466eac2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 19 deletions

View file

@ -630,41 +630,43 @@ class WebAssetServer implements AssetReader {
return webSdkFile;
}
// TODO(yjbanov): https://github.com/flutter/flutter/issues/70121
static const Map<WebRendererMode, Map<NullSafetyMode, Artifact>> _dartSdkJsArtifactMap =
<WebRendererMode, Map<NullSafetyMode, Artifact>> {
WebRendererMode.autoDetect: <NullSafetyMode, Artifact> {
NullSafetyMode.sound: Artifact.webPrecompiledCanvaskitAndHtmlSoundSdk,
NullSafetyMode.unsound: Artifact.webPrecompiledCanvaskitAndHtmlSdk,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitAndHtmlSoundSdk,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitAndHtmlSdk,
},
WebRendererMode.canvaskit: <NullSafetyMode, Artifact> {
NullSafetyMode.sound: Artifact.webPrecompiledCanvaskitSoundSdk,
NullSafetyMode.unsound: Artifact.webPrecompiledCanvaskitSdk,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitSoundSdk,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitSdk,
},
WebRendererMode.html: <NullSafetyMode, Artifact> {
NullSafetyMode.sound: Artifact.webPrecompiledSoundSdk,
NullSafetyMode.unsound: Artifact.webPrecompiledSdk,
NullSafetyMode.autodetect: Artifact.webPrecompiledSoundSdk,
NullSafetyMode.autodetect: Artifact.webPrecompiledSdk,
},
};
// TODO(yjbanov): https://github.com/flutter/flutter/issues/70121
static const Map<WebRendererMode, Map<NullSafetyMode, Artifact>> _dartSdkJsMapArtifactMap =
<WebRendererMode, Map<NullSafetyMode, Artifact>> {
WebRendererMode.autoDetect: <NullSafetyMode, Artifact> {
NullSafetyMode.sound: Artifact.webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps,
NullSafetyMode.unsound: Artifact.webPrecompiledCanvaskitAndHtmlSdkSourcemaps,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitAndHtmlSdkSourcemaps,
},
WebRendererMode.canvaskit: <NullSafetyMode, Artifact> {
NullSafetyMode.sound: Artifact.webPrecompiledCanvaskitSoundSdkSourcemaps,
NullSafetyMode.unsound: Artifact.webPrecompiledCanvaskitSdkSourcemaps,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitSoundSdkSourcemaps,
NullSafetyMode.autodetect: Artifact.webPrecompiledCanvaskitSdkSourcemaps,
},
WebRendererMode.html: <NullSafetyMode, Artifact> {
NullSafetyMode.sound: Artifact.webPrecompiledSoundSdkSourcemaps,
NullSafetyMode.unsound: Artifact.webPrecompiledSdkSourcemaps,
NullSafetyMode.autodetect: Artifact.webPrecompiledSoundSdkSourcemaps,
NullSafetyMode.autodetect: Artifact.webPrecompiledSdkSourcemaps,
},
};

View file

@ -756,24 +756,24 @@ void main() {
.childFile('web_entrypoint.dart')
..createSync(recursive: true)
..writeAsStringSync('GENERATED');
final String webPrecompiledSoundSdk = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledSoundSdk);
final String webPrecompiledSoundSdkSourcemaps = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledSoundSdkSourcemaps);
final String webPrecompiledCanvaskitSoundSdk = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledCanvaskitSoundSdk);
final String webPrecompiledCanvaskitSoundSdkSourcemaps = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledCanvaskitSoundSdkSourcemaps);
globals.fs.file(webPrecompiledSoundSdk)
final String webPrecompiledSdk = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledSdk);
final String webPrecompiledSdkSourcemaps = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledSdkSourcemaps);
final String webPrecompiledCanvaskitSdk = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledCanvaskitSdk);
final String webPrecompiledCanvaskitSdkSourcemaps = globals.artifacts
.getArtifactPath(Artifact.webPrecompiledCanvaskitSdkSourcemaps);
globals.fs.file(webPrecompiledSdk)
..createSync(recursive: true)
..writeAsStringSync('HELLO');
globals.fs.file(webPrecompiledSoundSdkSourcemaps)
globals.fs.file(webPrecompiledSdkSourcemaps)
..createSync(recursive: true)
..writeAsStringSync('THERE');
globals.fs.file(webPrecompiledCanvaskitSoundSdk)
globals.fs.file(webPrecompiledCanvaskitSdk)
..createSync(recursive: true)
..writeAsStringSync('OL');
globals.fs.file(webPrecompiledCanvaskitSoundSdkSourcemaps)
globals.fs.file(webPrecompiledCanvaskitSdkSourcemaps)
..createSync(recursive: true)
..writeAsStringSync('CHUM');
@ -798,7 +798,7 @@ void main() {
expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js.map'), 'THERE');
// Update to the SDK.
globals.fs.file(webPrecompiledSoundSdk).writeAsStringSync('BELLOW');
globals.fs.file(webPrecompiledSdk).writeAsStringSync('BELLOW');
// New SDK should be visible..
expect(await webDevFS.webAssetServer.dartSourceContents('dart_sdk.js'), 'BELLOW');