Don't remove toString implementations while in debug mode. (#154216)

This matches the behavior of AOT/VM compilation.
This commit is contained in:
Jackson Gardner
2024-08-28 13:19:48 -07:00
committed by GitHub
parent d147e52d6a
commit b95548e31c
2 changed files with 39 additions and 11 deletions

View File

@@ -35,8 +35,6 @@ const List<String> _kDart2WasmLinuxArgs = <String> [
'wasm',
'--packages=/.dart_tool/package_config.json',
'--extra-compiler-option=--platform=HostArtifact.webPlatformKernelFolder/dart2wasm_platform.dill',
'--extra-compiler-option=--delete-tostring-package-uri=dart:ui',
'--extra-compiler-option=--delete-tostring-package-uri=package:flutter',
];
void main() {
@@ -1034,12 +1032,16 @@ void main() {
processManager.addCommand(FakeCommand(
command: <String>[
..._kDart2WasmLinuxArgs,
'-Ddart.vm.profile=${buildMode == 'profile'}',
'-Ddart.vm.product=${buildMode == 'release'}',
if (buildMode != 'debug') ...<String>[
'--extra-compiler-option=--delete-tostring-package-uri=dart:ui',
'--extra-compiler-option=--delete-tostring-package-uri=package:flutter',
],
if (renderer == WebRendererMode.skwasm) ...<String>[
'--extra-compiler-option=--import-shared-memory',
'--extra-compiler-option=--shared-memory-max-pages=32768',
],
if (buildMode != 'debug')
'-Ddart.vm.${buildMode == 'release' ? 'product' : 'profile' }=true',
...defines.map((String define) => '-D$define'),
if (renderer == WebRendererMode.skwasm) ...<String>[
'-DFLUTTER_WEB_AUTO_DETECT=false',