@@ -243,18 +243,6 @@ var LibraryEmbind = {
243243    } 
244244
245245  } , 
246-   $printProperty : ( prop ,  nameMap ,  out )  =>  { 
247-     const  setType  =  nameMap ( prop . type ,  false ) ; 
248-     const  getType  =  nameMap ( prop . type ,  true ) ; 
249-     if  ( prop . readonly  ||  setType  ===  getType )  { 
250-       out . push ( `${ prop . readonly  ? 'readonly '  : '' } ${ prop . name }  : ${ getType }  ` ) ; 
251-       return ; 
252-     } 
253-     // The getter/setter types don't match, so generate each get/set definition. 
254-     out . push ( `get ${ prop . name }  (): ${ getType }  ` ) ; 
255-     out . push ( `set ${ prop . name }  (value: ${ setType }  )` ) ; 
256-   } , 
257-   $ClassProperty__deps : [ '$printProperty' ] , 
258246  $ClassProperty : class  { 
259247    constructor ( type ,  name ,  readonly )  { 
260248      this . type  =  type ; 
@@ -263,7 +251,15 @@ var LibraryEmbind = {
263251    } 
264252
265253    print ( nameMap ,  out )  { 
266-       printProperty ( this ,  nameMap ,  out ) ; 
254+       const  setType  =  nameMap ( this . type ,  false ) ; 
255+       const  getType  =  nameMap ( this . type ,  true ) ; 
256+       if  ( this . readonly  ||  setType  ===  getType )  { 
257+         out . push ( `${ this . readonly  ? 'readonly '  : '' } ${ this . name }  : ${ getType }  ` ) ; 
258+         return ; 
259+       } 
260+       // The getter/setter types don't match, so generate each get/set definition. 
261+       out . push ( `get ${ this . name }  (): ${ getType }  ` ) ; 
262+       out . push ( `set ${ this . name }  (value: ${ setType }  )` ) ; 
267263    } 
268264  } , 
269265  $ConstantDefinition : class  { 
@@ -329,7 +325,6 @@ var LibraryEmbind = {
329325      out . push ( ' ];\n\n' ) ; 
330326    } 
331327  } , 
332-   $ValueObjectDefinition__deps : [ '$printProperty' ] , 
333328  $ValueObjectDefinition : class  { 
334329    constructor ( typeId ,  name )  { 
335330      this . typeId  =  typeId ; 
@@ -341,14 +336,12 @@ var LibraryEmbind = {
341336    } 
342337
343338    print ( nameMap ,  out )  { 
344-       out . push ( `export type ${ this . name }   = {\n   ` ) ; 
339+       out . push ( `export type ${ this . name }   = {\n` ) ; 
345340      const  outFields  =  [ ] ; 
346-       for  ( const  field  of  this . fields )  { 
347-         const  property  =  [ ] ; 
348-         printProperty ( field ,  nameMap ,  property ) ; 
349-         outFields . push ( ...property ) ; 
341+       for  ( const  { name,  type}  of  this . fields )  { 
342+         outFields . push ( `  ${ name }  : ${ nameMap ( type ) }  ` ) ; 
350343      } 
351-       out . push ( outFields . join ( ',\n   ' ) ) 
344+       out . push ( outFields . join ( ',\n' ) ) 
352345      out . push ( '\n};\n\n' ) ; 
353346    } 
354347  } , 
0 commit comments