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,OAAO,EAAsB,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IACL,iCAAC;AAAD,CAAC,AA5CD,CAAgD,mCAAsB,GA4CrE;AA5CY,0BAA0B;IADtC,sBAAS,CAAC,EAAC,IAAI,EAAE,yBAAyB,EAAC,CAAC;GAChC,0BAA0B,CA4CtC;AA5CY,gEAA0B","sourcesContent":["import * as ts from 'typescript';\nimport * as _ts from '../../ts-internal';\n\nimport {Reflection} from '../../models/index';\nimport {Context} from '../context';\nimport {Component, ConverterNodeComponent} from '../components';\n\n@Component({name: 'node:variable-statement'})\nexport class VariableStatementConverter extends ConverterNodeComponent<ts.VariableStatement> {\n /**\n * List of supported TypeScript syntax kinds.\n */\n supports: ts.SyntaxKind[] = [\n ts.SyntaxKind.VariableStatement\n ];\n\n /**\n * Analyze the given variable statement node and create a suitable reflection.\n *\n * @param context The context object describing the current state the converter is in.\n * @param node The variable statement node that should be analyzed.\n * @return The resulting reflection or NULL.\n */\n convert(context: Context, node: ts.VariableStatement): Reflection {\n if (node.declarationList && node.declarationList.declarations) {\n node.declarationList.declarations.forEach((variableDeclaration) => {\n if (_ts.isBindingPattern(variableDeclaration.name)) {\n this.convertBindingPattern(context, <ts.BindingPattern> variableDeclaration.name);\n } else {\n this.owner.convertNode(context, variableDeclaration);\n }\n });\n }\n\n return context.scope;\n }\n\n /**\n * Traverse the elements of the given binding pattern and create the corresponding variable reflections.\n *\n * @param context The context object describing the current state the converter is in.\n * @param node The binding pattern node that should be analyzed.\n */\n convertBindingPattern(context: Context, node: ts.BindingPattern) {\n (node.elements as ts.BindingElement[]).forEach((element: ts.BindingElement) => {\n this.owner.convertNode(context, element);\n\n if (_ts.isBindingPattern(element.name)) {\n this.convertBindingPattern(context, <ts.BindingPattern> element.name);\n }\n });\n }\n}\n"]}
|