@@ -38,20 +38,20 @@ export function transformDestructuringAssignment(
3838 node : ts . DestructuringAssignment ,
3939 root : lua . Expression
4040) : lua . Statement [ ] {
41- switch ( node . left . kind ) {
42- case ts . SyntaxKind . ObjectLiteralExpression :
43- return transformObjectDestructuringAssignment ( context , node as ts . ObjectDestructuringAssignment , root ) ;
44- case ts . SyntaxKind . ArrayLiteralExpression :
45- return transformArrayDestructuringAssignment ( context , node as ts . ArrayDestructuringAssignment , root ) ;
46- }
41+ return transformAssignmentPattern ( context , node . left , root ) ;
4742}
4843
49- function transformArrayDestructuringAssignment (
44+ export function transformAssignmentPattern (
5045 context : TransformationContext ,
51- node : ts . ArrayDestructuringAssignment ,
46+ node : ts . AssignmentPattern ,
5247 root : lua . Expression
5348) : lua . Statement [ ] {
54- return transformArrayLiteralAssignmentPattern ( context , node . left , root ) ;
49+ switch ( node . kind ) {
50+ case ts . SyntaxKind . ObjectLiteralExpression :
51+ return transformObjectLiteralAssignmentPattern ( context , node , root ) ;
52+ case ts . SyntaxKind . ArrayLiteralExpression :
53+ return transformArrayLiteralAssignmentPattern ( context , node , root ) ;
54+ }
5555}
5656
5757function transformArrayLiteralAssignmentPattern (
@@ -136,14 +136,6 @@ function transformArrayLiteralAssignmentPattern(
136136 } ) ;
137137}
138138
139- function transformObjectDestructuringAssignment (
140- context : TransformationContext ,
141- node : ts . ObjectDestructuringAssignment ,
142- root : lua . Expression
143- ) : lua . Statement [ ] {
144- return transformObjectLiteralAssignmentPattern ( context , node . left , root ) ;
145- }
146-
147139function transformObjectLiteralAssignmentPattern (
148140 context : TransformationContext ,
149141 node : ts . ObjectLiteralExpression ,
0 commit comments