diff --git a/http/http.ts b/http/http.ts index b27f4cf9c54..807b9f2b169 100644 --- a/http/http.ts +++ b/http/http.ts @@ -61,9 +61,9 @@ namespace $ { } @ $mol_mem - json< Content >( next? : Content , force? : $mol_mem_force ) : Content { + json< Content >( next? : Content , force? : $mol_mem_force ) { const next2 = next && JSON.stringify( next , null , '\t' ) - return this.response( next2 , force ).json() + return this.response( next2 , force ).json() as Content } } diff --git a/image/image.view.tree b/image/image.view.tree index 005252fcbf3..cd0b4f39f7b 100644 --- a/image/image.view.tree +++ b/image/image.view.tree @@ -1,17 +1,17 @@ $mol_image $mol_view dom_name \img - field * + field *any ^ src <= uri \ alt <= title loading <= loading \eager decoding <= decoding \async crossOrigin <= cors null - attr * + attr *any ^ width <= natural_width? 0 height <= natural_height? 0 - event * + event *any load? <=> load? null minimal_width 16 minimal_height 16 diff --git a/state/shared/shared.ts b/state/shared/shared.ts index cf786100e9a..38ca6e4e70b 100644 --- a/state/shared/shared.ts +++ b/state/shared/shared.ts @@ -336,7 +336,7 @@ namespace $ { send( key: string, next?: readonly $hyoo_crowd_chunk[] ) { const socket = this.socket() - $mol_wire_sync( this ).wait_connection() + $mol_wire_sync( this ).wait_connection()/* */ if( socket.readyState !== socket.OPEN ) return diff --git a/view/tree2/to/dts/dts.ts b/view/tree2/to/dts/dts.ts index ebce3f2c4d6..56f20a00b82 100644 --- a/view/tree2/to/dts/dts.ts +++ b/view/tree2/to/dts/dts.ts @@ -119,7 +119,14 @@ namespace $ { const val = prop.hack({ - 'null': val => val.kids[0]?.value ? [ val.kids[0], val.data( ' | null' ) ]: [ val.data( 'any' ) ], + 'null': val => { + const kid = val.kids[0] + const kid_data = kid?.type ? kid.data(kid.type) : undefined + + return kid_data + ? [ kid_data, val.data( ' | null' ) ] + : [ val.data( 'any' ) ] + }, 'true': val => [ val.data( 'boolean' ) ], 'false': val => [ val.data( 'boolean' ) ], diff --git a/view/tree2/to/js/test/ex/simple_typed_null.view.tree b/view/tree2/to/js/test/ex/simple_typed_null.view.tree index 1cec526eb4d..73682ebae68 100644 --- a/view/tree2/to/js/test/ex/simple_typed_null.view.tree +++ b/view/tree2/to/js/test/ex/simple_typed_null.view.tree @@ -1,2 +1,2 @@ $mol_view_tree2_to_js_test_ex_simple_typed_null_foo $mol_object - a null \string|number + a null string|number diff --git a/view/tree2/to/js/test/js.simple.test.ts b/view/tree2/to/js/test/js.simple.test.ts index 24e7307b70f..95aed5d2d47 100644 --- a/view/tree2/to/js/test/js.simple.test.ts +++ b/view/tree2/to/js/test/js.simple.test.ts @@ -12,6 +12,8 @@ namespace $ { const _foo = $mol_view_tree2_to_js_test_ex_simple_mutable_and_read_only_foo const foo = _foo.make({ $ }) + + type assert_ro = $mol_type_assert, any> $mol_assert_equal( foo.readonly(), diff --git a/webdav/webdav.ts b/webdav/webdav.ts index 8e33a35f1db..c28b09f97fe 100644 --- a/webdav/webdav.ts +++ b/webdav/webdav.ts @@ -17,7 +17,7 @@ namespace $ { const data = {} as { [ uri : string ] : Element } for( let response of responses ) { - const uri = this.resolve( response.querySelector( 'href' ).textContent ).uri() + const uri = this.resolve( response.querySelector( 'href' )?.textContent ?? '' ).uri() data[ uri ] = response } @@ -86,7 +86,7 @@ namespace $ { } prop( prop: string ) { - return this.data_self()[ this.uri() ].querySelector( prop ).textContent + return this.data_self()[ this.uri() ]?.querySelector( prop )?.textContent } type() {