Skip to content

Commit 00478a7

Browse files
jason-simmonsCommit Queue
authored andcommitted
[dart2wasm] Parse envrionment defines whose values contain equal sign characters
Closes flutter/flutter#159840 Bug: 159840 Change-Id: I116b3877618e6d98041ebb3da42676c08d2a948e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400042 Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Jason Simmons <[email protected]>
1 parent 668cec8 commit 00478a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/dart2wasm/lib/dart2wasm.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ Map<fe.ExperimentalFlag, bool> processFeExperimentalFlags(
112112

113113
Map<String, String> processEnvironment(List<String> defines) =>
114114
Map<String, String>.fromEntries(defines.map((d) {
115-
List<String> keyAndValue = d.split('=');
116-
if (keyAndValue.length != 2) {
115+
int index = d.indexOf('=');
116+
if (index == -1) {
117117
throw ArgumentError('Bad define string: $d');
118118
}
119-
return MapEntry<String, String>(keyAndValue[0], keyAndValue[1]);
119+
return MapEntry<String, String>(d.substring(0, index), d.substring(index + 1));
120120
}));
121121

122122
WasmCompilerOptions parseArguments(List<String> arguments) {

0 commit comments

Comments
 (0)