File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -824,7 +824,7 @@ export abstract class LuaTranspiler {
824824 case ts . SyntaxKind . MinusMinusToken :
825825 return `${ operand } =${ operand } -1` ;
826826 case ts . SyntaxKind . ExclamationToken :
827- return `not ${ operand } ` ;
827+ return `( not ${ operand } ) ` ;
828828 case ts . SyntaxKind . MinusToken :
829829 return `-${ operand } ` ;
830830 default :
@@ -1132,7 +1132,7 @@ export abstract class LuaTranspiler {
11321132
11331133 public transpileTypeOfExpression ( node : ts . TypeOfExpression ) : string {
11341134 const expression = this . transpileExpression ( node . expression ) ;
1135- return `type(${ expression } ) == "table" and "object" or type(${ expression } )` ;
1135+ return `( type(${ expression } ) == "table" and "object" or type(${ expression } ) )` ;
11361136 }
11371137
11381138 // Transpile a variable statement
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export class ExpressionTests {
1010 @TestCase ( "++i" , "i=i+1" )
1111 @TestCase ( "i--" , "i=i-1" )
1212 @TestCase ( "--i" , "i=i-1" )
13- @TestCase ( "!a" , "not a" )
13+ @TestCase ( "!a" , "( not a) " )
1414 @TestCase ( "-a" , "-a" )
1515 @TestCase ( "delete tbl['test']" , "tbl[\"test\"]=nil" )
1616 @TestCase ( "delete tbl.test" , "tbl.test=nil" )
You can’t perform that action at this time.
0 commit comments