File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -2683,17 +2683,24 @@ export class EmitterLua {
26832683 }
26842684
26852685 private processParenthesizedExpression ( node : ts . ParenthesizedExpression ) {
2686- this . functionContext . textCode . push ( "(" ) ;
2686+ const skip =
2687+ node . expression . kind !== ts . SyntaxKind . TypeAssertionExpression
2688+ && node . expression . kind !== ts . SyntaxKind . PropertyAccessExpression ;
2689+ if ( skip )
2690+ {
2691+ this . functionContext . textCode . push ( "(" ) ;
2692+ }
2693+
26872694 this . processExpression ( node . expression ) ;
2688- this . functionContext . textCode . push ( ")" ) ;
2695+
2696+ if ( skip )
2697+ {
2698+ this . functionContext . textCode . push ( ")" ) ;
2699+ }
26892700 }
26902701
26912702 private processTypeAssertionExpression ( node : ts . TypeAssertion ) {
26922703 this . processExpression ( node . expression ) ;
2693-
2694- if ( node . type . kind === ts . SyntaxKind . InterfaceDeclaration ) {
2695- //
2696- }
26972704 }
26982705
26992706 private processPrefixUnaryExpression ( node : ts . PrefixUnaryExpression ) : void {
Original file line number Diff line number Diff line change 1- let a = 1 ;
2- let count = 0 ;
3- while ( a ) {
4- a -- ;
5- count ++ ;
6- }
7- console . log ( count ) ;
1+ var a = { value : 1 } ;
2+ console . log ( < any > ( ++ ( ( < any > a ) . value ) ) ) ;
3+ console . log ( < any > ( -- ( ( < any > a ) . value ) ) ) ;
4+ console . log ( < any > ( ( ( < any > a ) . value ) ++ ) ) ;
5+ console . log ( < any > ( ( ( < any > a ) . value ) -- ) ) ;
You can’t perform that action at this time.
0 commit comments