explanatory comment

pull/16270/head
Rich Harris 3 months ago
parent 393332805e
commit 0ef587aa6a

@ -322,7 +322,15 @@ export function prop(props, key, flags, fallback) {
} else { } else {
getter = () => { getter = () => {
var value = /** @type {V} */ (props[key]); var value = /** @type {V} */ (props[key]);
if (value !== undefined) fallback_value = /** @type {V} */ (undefined);
if (value !== undefined) {
// in legacy mode, we don't revert to the fallback value
// if the prop goes from defined to undefined. The easiest
// way to model this is to make the fallback undefined
// as soon as the prop has a value
fallback_value = /** @type {V} */ (undefined);
}
return value === undefined ? fallback_value : value; return value === undefined ? fallback_value : value;
}; };
} }

Loading…
Cancel
Save