@@ -419,7 +419,7 @@ export abstract class LuaTranspiler {
419419 public transpileContinue ( node : ts . ContinueStatement ) : string {
420420 throw new TranspileError (
421421 `Unsupported continue statement, ` +
422- `continue is not supported in Lua ${ this . options . luaTarget } .` ,
422+ `continue is not supported for target Lua ${ this . options . luaTarget } .` ,
423423 node
424424 ) ;
425425 }
@@ -881,11 +881,11 @@ export abstract class LuaTranspiler {
881881 }
882882
883883 public transpileUnaryBitOperation ( node : ts . PrefixUnaryExpression , operand : string ) : string {
884- throw new TranspileError ( `Bit operations are not supported in Lua ${ this . options . target } ` , node ) ;
884+ throw new TranspileError ( `Bit operations are not supported for target Lua ${ this . options . target } ` , node ) ;
885885 }
886886
887887 public transpileBitOperation ( node : ts . BinaryExpression , lhs : string , rhs : string ) : string {
888- throw new TranspileError ( `Bit operations are not supported in Lua ${ this . options . target } ` , node ) ;
888+ throw new TranspileError ( `Bit operations are not supported for target Lua ${ this . options . target } ` , node ) ;
889889 }
890890
891891 public transpileTemplateExpression ( node : ts . TemplateExpression ) : string {
@@ -1088,7 +1088,7 @@ export abstract class LuaTranspiler {
10881088 return `${ translation [ identifierString ] } ` ;
10891089 } else {
10901090 throw new TranspileError ( `Unsupported string property ${ identifierString } , ` +
1091- `is not supported in Lua ${ this . options . luaTarget } .` ,
1091+ `is not supported for target Lua ${ this . options . luaTarget } .` ,
10921092 identifier ) ;
10931093 }
10941094 }
@@ -1303,11 +1303,11 @@ export abstract class LuaTranspiler {
13031303 return result ;
13041304 }
13051305
1306- // Implemented in 5.1 and overridden in 5.2 (and onwards)
1307- public transpileVariableDestructuring ( value : string ) : string {
1306+ public transpileDestructingAssignmentValue ( node : ts . Expression ) : string {
13081307 throw new TranspileError (
1309- `transpileVariableDestructuring must be implemented!` ,
1310- null
1308+ `Unsupported destructing statement, ` +
1309+ `destructing statements are not supported for target Lua ${ this . options . luaTarget } .` ,
1310+ node
13111311 ) ;
13121312 }
13131313
@@ -1330,13 +1330,12 @@ export abstract class LuaTranspiler {
13301330 }
13311331
13321332 const vars = node . name . elements . map ( e => this . transpileArrayBindingElement ( e ) ) . join ( "," ) ;
1333- const value = this . transpileExpression ( node . initializer ) ;
13341333
13351334 // Don't unpack TupleReturn decorated functions
13361335 if ( tsHelper . isTupleReturnCall ( node . initializer , this . checker ) ) {
1337- return `local ${ vars } =${ value } \n` ;
1336+ return `local ${ vars } =${ this . transpileExpression ( node . initializer ) } \n` ;
13381337 } else {
1339- return `local ${ vars } =${ this . transpileVariableDestructuring ( value ) } \n` ;
1338+ return `local ${ vars } =${ this . transpileDestructingAssignmentValue ( node . initializer ) } \n` ;
13401339 }
13411340 } else {
13421341 throw new TranspileError (
0 commit comments