Skip to content

Commit

Permalink
$mol_view_tree2_to_js delegate check
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Oct 23, 2023
1 parent 77fa062 commit 9512b96
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions view/tree2/to/js/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Context>({

Expand Down Expand Up @@ -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[]
Expand Down Expand Up @@ -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' ),
Expand Down

0 comments on commit 9512b96

Please sign in to comment.