@@ -2902,7 +2902,6 @@ export class EmitterLua {
29022902 this . processBinaryExpressionEqualOp ( node , this . ops [ node . operatorToken . kind ] , this . strOps [ node . operatorToken . kind ] ) ;
29032903 break ;
29042904 case ts . SyntaxKind . EqualsEqualsToken :
2905- case ts . SyntaxKind . AmpersandAmpersandToken :
29062905 if ( this . ignoreExtraLogic ) {
29072906 this . processBinaryExpressionSingleOp ( node , this . ops [ node . operatorToken . kind ] , this . strOps [ node . operatorToken . kind ] ) ;
29082907 } else {
@@ -2911,6 +2910,7 @@ export class EmitterLua {
29112910
29122911 break ;
29132912 case ts . SyntaxKind . BarBarToken :
2913+ case ts . SyntaxKind . AmpersandAmpersandToken :
29142914 if ( this . ignoreExtraLogic ) {
29152915 this . processBinaryExpressionSingleOp ( node , this . ops [ node . operatorToken . kind ] , this . strOps [ node . operatorToken . kind ] ) ;
29162916 } else {
@@ -2922,8 +2922,18 @@ export class EmitterLua {
29222922
29232923 this . functionContext . textCode . push ( "local op" + opIndex + " = " ) ;
29242924 this . processExpression ( node . left ) ;
2925- this . functionContext . textCode . push ( " if __is_true(op" + opIndex + ") then return op" + opIndex + " else return " ) ;
2926- this . processExpression ( node . right ) ;
2925+ this . functionContext . textCode . push ( " if __is_true(op" + opIndex + ") then" ) ;
2926+ if ( node . operatorToken . kind === ts . SyntaxKind . BarBarToken )
2927+ {
2928+ this . functionContext . textCode . push ( " return op" + opIndex ) ;
2929+ this . functionContext . textCode . push ( " else return " ) ;
2930+ this . processExpression ( node . right ) ;
2931+ } else {
2932+ this . functionContext . textCode . push ( " return " ) ;
2933+ this . processExpression ( node . right ) ;
2934+ this . functionContext . textCode . push ( " else return op" + opIndex ) ;
2935+ }
2936+
29272937 this . functionContext . textCode . push ( " end end)()" ) ;
29282938 }
29292939
0 commit comments