@@ -597,6 +597,7 @@ export abstract class LuaTranspiler {
597597 // Otherwise simply return the name
598598 return ( node as ts . Identifier ) . text ;
599599 case ts . SyntaxKind . StringLiteral :
600+ case ts . SyntaxKind . NoSubstitutionTemplateLiteral :
600601 const text = ( node as ts . StringLiteral ) . text ;
601602 return `"${ text } "` ;
602603 case ts . SyntaxKind . TemplateExpression :
@@ -639,6 +640,8 @@ export abstract class LuaTranspiler {
639640 case ts . SyntaxKind . AsExpression :
640641 // Also ignore as casts
641642 return this . transpileExpression ( ( node as ts . AsExpression ) . expression ) ;
643+ case ts . SyntaxKind . TypeOfExpression :
644+ return this . transpileTypeOfExpression ( node as ts . TypeOfExpression ) ;
642645 default :
643646 throw new TranspileError (
644647 "Unsupported expression kind: " + tsHelper . enumName ( node . kind , ts . SyntaxKind ) ,
@@ -755,6 +758,9 @@ export abstract class LuaTranspiler {
755758 case ts . SyntaxKind . InKeyword :
756759 result = `${ rhs } [${ lhs } ]~=nil` ;
757760 break ;
761+ case ts . SyntaxKind . InstanceOfKeyword :
762+ result = `TS_instanceof(${ lhs } , ${ rhs } )` ;
763+ break ;
758764 default :
759765 throw new TranspileError (
760766 "Unsupported binary operator kind: " + ts . tokenToString ( node . operatorToken . kind ) ,
@@ -1124,6 +1130,11 @@ export abstract class LuaTranspiler {
11241130 }
11251131 }
11261132
1133+ public transpileTypeOfExpression ( node : ts . TypeOfExpression ) : string {
1134+ const expression = this . transpileExpression ( node . expression ) ;
1135+ return `type(${ expression } )` ;
1136+ }
1137+
11271138 // Transpile a variable statement
11281139 public transpileVariableStatement ( node : ts . VariableStatement ) : string {
11291140 let result = "" ;
0 commit comments