Fix unset versionFlags (#4922)

Closes #4921

```
> a = ("")?.split("|")
[ '' ]
> a = (undefined)?.split("|")
undefined
> a = ("a|b")?.split("|")
[ 'a', 'b' ]
```
This commit is contained in:
Matt Godbolt
2023-04-01 20:38:08 -05:00
committed by GitHub
parent 54a99f6d51
commit 436d84bdb5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -258,7 +258,7 @@ export class CompilerFinder {
.split(':')
.filter(a => a !== ''),
options: actualOptions,
versionFlag: props('versionFlag', '').split('|'),
versionFlag: props<string>('versionFlag')?.split('|'),
versionRe: props<string>('versionRe'),
explicitVersion: props<string>('explicitVersion'),
compilerType: props('compilerType', ''),
+1 -1
View File
@@ -36,7 +36,7 @@ export type CompilerInfo = {
baseName: string;
alias: string[];
options: string;
versionFlag?: string[];
versionFlag: string[] | undefined;
versionRe?: string;
explicitVersion?: string;
compilerType: string;