From 9512b9614893ea8c90ae215391c966c20fd6d7c3 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Tue, 24 Oct 2023 01:37:27 +0300 Subject: [PATCH] $mol_view_tree2_to_js delegate check --- view/tree2/to/js/js.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/view/tree2/to/js/js.ts b/view/tree2/to/js/js.ts index 8b7022a9b7e..cc14871d8de 100644 --- a/view/tree2/to/js/js.ts +++ b/view/tree2/to/js/js.ts @@ -74,8 +74,9 @@ namespace $ { ] ), ] ) } - - if( next ) addons.push( decorate() ) + const op = prop.kids[0] + const is_delegate = op?.type === '<=' || op?.type === '<=>' + if( ! is_delegate && next ) addons.push( decorate() ) const val = prop.hack({ @@ -154,7 +155,7 @@ namespace $ { ] if( /^[$A-Z]/.test( input.type ) ) { - + const is_delegate = input.type === '<=' || input.type === '<=>' if( !next ) addons.push( decorate() ) const overrides = [] as $mol_tree2[] @@ -261,7 +262,7 @@ namespace $ { prop.data( name ), params_of( prop ), prop.struct( '{;}', [ - ... next ? [ + ... next && ! is_delegate ? [ prop.struct( 'if', [ prop.struct( '(!==)', [ prop.struct( 'next' ),