@@ -58,7 +58,6 @@ class TSLEncoder {
5858 this . global = new Set ( ) ;
5959 this . overloadings = new Map ( ) ;
6060 this . iife = false ;
61- this . uniqueNames = false ;
6261 this . reference = false ;
6362
6463 this . _currentVariable = null ;
@@ -726,8 +725,6 @@ ${ this.tab }} )`;
726725
727726 for ( const param of node . params ) {
728727
729- let str = `{ name: '${ param . name } ', type: '${ param . type } '` ;
730-
731728 let name = param . name ;
732729
733730 if ( param . immutable === false && ( param . qualifier !== 'inout' && param . qualifier !== 'out' ) ) {
@@ -746,11 +743,9 @@ ${ this.tab }} )`;
746743
747744 }
748745
749- str += ', qualifier: \'' + param . qualifier + '\'' ;
750-
751746 }
752747
753- inputs . push ( str + ' } ' ) ;
748+ inputs . push ( param . name + ': \'' + param . type + '\' ' ) ;
754749 params . push ( name ) ;
755750
756751 this . _currentProperties [ name ] = param ;
@@ -795,23 +790,15 @@ ${ this.tab }} )`;
795790
796791${ bodyStr }
797792
798- ${ this . tab } } )`;
799-
800- const layoutInput = inputs . length > 0 ? '\n\t\t' + this . tab + inputs . join ( ',\n\t\t' + this . tab ) + '\n\t' + this . tab : '' ;
793+ ${ this . tab } }`;
801794
802795 if ( node . layout !== false && hasPointer === false ) {
803796
804- const uniqueName = this . uniqueNames ? fnName + '_' + Math . random ( ) . toString ( 36 ) . slice ( 2 ) : fnName ;
805-
806- funcStr += `.setLayout( {
807- ${ this . tab } \tname: '${ uniqueName } ',
808- ${ this . tab } \ttype: '${ type } ',
809- ${ this . tab } \tinputs: [${ layoutInput } ]
810- ${ this . tab } } )`;
797+ funcStr += ', { ' + inputs . join ( ', ' ) + ', return: \'' + type + '\' }' ;
811798
812799 }
813800
814- funcStr += ';\n' ;
801+ funcStr += ' ) ;\n' ;
815802
816803 this . imports . add ( 'Fn' ) ;
817804
0 commit comments