@ -27,7 +27,7 @@ export function create_ownership_validator(props) {
* /
* /
mutation : ( prop , path , result , line , column ) => {
mutation : ( prop , path , result , line , column ) => {
const name = path [ 0 ] ;
const name = path [ 0 ] ;
if ( is _bound ( props , name ) || ! parent ) {
if ( is _bound _or _unset ( props , name ) || ! parent ) {
return result ;
return result ;
}
}
@ -52,7 +52,7 @@ export function create_ownership_validator(props) {
* @ param { ( ) => any } value
* @ param { ( ) => any } value
* /
* /
binding : ( key , child _component , value ) => {
binding : ( key , child _component , value ) => {
if ( ! is _bound ( props , key ) && parent && value ( ) ? . [ STATE _SYMBOL ] ) {
if ( ! is _bound _or _unset ( props , key ) && parent && value ( ) ? . [ STATE _SYMBOL ] ) {
w . ownership _invalid _binding (
w . ownership _invalid _binding (
component [ FILENAME ] ,
component [ FILENAME ] ,
key ,
key ,
@ -68,9 +68,13 @@ export function create_ownership_validator(props) {
* @ param { Record < string , any > } props
* @ param { Record < string , any > } props
* @ param { string } prop _name
* @ param { string } prop _name
* /
* /
function is _bound ( props , prop _name ) {
function is _bound _or _unset ( props , prop _name ) {
// Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`
// Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`
// or `createClassComponent(Component, props)`
// or `createClassComponent(Component, props)`
const is _entry _props = STATE _SYMBOL in props || LEGACY _PROPS in props ;
const is _entry _props = STATE _SYMBOL in props || LEGACY _PROPS in props ;
return ! ! get _descriptor ( props , prop _name ) ? . set || ( is _entry _props && prop _name in props ) ;
return (
! ! get _descriptor ( props , prop _name ) ? . set ||
( is _entry _props && prop _name in props ) ||
! ( prop _name in props )
) ;
}
}