Fix an edge-case related to compatibility-values in various AppOptions
-methods
Given how the compatibility-values are being handled, it's not actually possible to override a *truthy* default-value with a *falsy* compatibility-value. This is a simple oversight on my part, and with modern ECMAScript features this is very easy to support.
This commit is contained in:
parent
18bc59eb34
commit
7bcfabc43c
@ -297,7 +297,7 @@ class AppOptions {
|
|||||||
}
|
}
|
||||||
const defaultOption = defaultOptions[name];
|
const defaultOption = defaultOptions[name];
|
||||||
if (defaultOption !== undefined) {
|
if (defaultOption !== undefined) {
|
||||||
return defaultOption.compatibility || defaultOption.value;
|
return defaultOption.compatibility ?? defaultOption.value;
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -329,7 +329,7 @@ class AppOptions {
|
|||||||
options[name] =
|
options[name] =
|
||||||
userOption !== undefined
|
userOption !== undefined
|
||||||
? userOption
|
? userOption
|
||||||
: defaultOption.compatibility || defaultOption.value;
|
: defaultOption.compatibility ?? defaultOption.value;
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user