• Home
  • Raw
  • Download

Lines Matching refs:ts

16 import ts from 'typescript';
185 export function processComponentBuild(node: ts.MethodDeclaration,
186 log: LogInfo[]): ts.MethodDeclaration {
187 let newNode: ts.MethodDeclaration;
188 let renderNode: ts.Identifier;
190 renderNode = ts.factory.createIdentifier(COMPONENT_RENDER_FUNCTION);
192 renderNode = ts.factory.createIdentifier(COMPONENT_INITIAl_RENDER_FUNCTION);
196 newNode = ts.factory.updateMethodDeclaration(node, ts.getModifiers(node),
200 newNode = ts.factory.updateMethodDeclaration(node, ts.getModifiers(node),
207 function createLazyForEachBlockNode(newStatements: ts.Statement[]): ts.IfStatement {
208 return ts.factory.createIfStatement(
209 ts.factory.createBinaryExpression(
210 ts.factory.createBinaryExpression(
211 ts.factory.createIdentifier(IS_INITIAL_ITEM),
212 ts.factory.createToken(ts.SyntaxKind.EqualsEqualsEqualsToken),
213 ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED)
215 ts.factory.createToken(ts.SyntaxKind.BarBarToken),
216 ts.factory.createIdentifier(IS_INITIAL_ITEM)
218 ts.factory.createBlock(newStatements, true),
219 ts.factory.createBlock([
220 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
221 ts.factory.createPropertyAccessExpression(
222 ts.factory.createThis(),
223 ts.factory.createIdentifier(UPDATE_LAZY_FOREACH_ELEMENTS)
225 ts.factory.createIdentifier(IDS),
226 storedFileInfo.lazyForEachInfo.forEachParameters.name as ts.Identifier
234 firstParam: ts.ParameterDeclaration;
237 export function parseGlobalBuilderParams(parameters: ts.NodeArray<ts.ParameterDeclaration>,
240 ts.isIdentifier(parameters[0].name)) {
245 export function processComponentBlock(node: ts.Block, isLazy: boolean, log: LogInfo[],
247 forEachParameters: ts.NodeArray<ts.ParameterDeclaration> = undefined,
249 rootGlobalBuilder: boolean = false): ts.Block {
250 const newStatements: ts.Statement[] = [];
258 newStatements.unshift(ts.factory.createExpressionStatement(
259 createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME),
260 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null)));
262 newStatements.unshift(createComponentCreationStatement(ts.factory.createExpressionStatement(
263 createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME),
264ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null)), [ts.factory.createExpressionStatement(
265 createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME),
266ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), null))], COMPONENT_TRANSITION_NAME, false,…
268 newStatements.push(ts.factory.createExpressionStatement(
269 createFunction(ts.factory.createIdentifier(COMPONENT_TRANSITION_NAME),
270 ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null)));
280 return ts.factory.updateBlock(node, [
283 ts.factory.createReturnStatement(ts.factory.createIdentifier(MY_IDS))
286 return ts.factory.updateBlock(node, newStatements);
289 function createMyIdsNode(): ts.Statement {
290 return ts.factory.createVariableStatement(
292 ts.factory.createVariableDeclarationList(
293 [ts.factory.createVariableDeclaration(
294 ts.factory.createIdentifier(MY_IDS),
297 ts.factory.createArrayLiteralExpression(
302 ts.NodeFlags.Const
307 function visitComponent(node: ts.Node): void {
308 if (storedFileInfo.lazyForEachInfo && !ts.isBlock(node)) {
309 ts.forEachChild(node, (child: ts.Node) => {
313 if (ts.isIdentifier(child)) {
314 const symbol: ts.Symbol = globalProgram.checker.getSymbolAtLocation(child);
325 function forkBuilderParamNode(node: ts.ParameterDeclaration): ts.Statement {
326 const paramNode: ts.Identifier = node.name as ts.Identifier;
327 return ts.factory.createVariableStatement(
329 ts.factory.createVariableDeclarationList(
330 [ts.factory.createVariableDeclaration(
331 ts.factory.createIdentifier(`__${paramNode.escapedText.toString()}__`),
336 ts.NodeFlags.Const
341 function validateRootNode(node: ts.MethodDeclaration, log: LogInfo[]): boolean {
344 const statement: ts.Statement = node.body.statements[0];
345 if (ts.isIfStatement(statement) || validateFirstNode(statement)) {
361 function validateFirstNode(node: ts.Statement): boolean {
370 function validateContainerComponent(node: ts.Statement): boolean {
371 if (ts.isExpressionStatement(node) && node.expression &&
372 (ts.isEtsComponentExpression(node.expression) || ts.isCallExpression(node.expression))) {
398 arguments: ts.NodeArray<ts.Expression> | [],
399 node?: ts.Node
402 function validateEtsComponentNode(node: ts.CallExpression | ts.EtsComponentExpression, result?: Nam…
403 let childNode: ts.Node = node;
405 while (ts.isCallExpression(childNode) && childNode.expression &&
406 ts.isPropertyAccessExpression(childNode.expression) && childNode.expression.expression) {
409 if (ts.isEtsComponentExpression(childNode)) {
410 if (ts.isIdentifier(childNode.expression)) {
421 let sourceNode: ts.SourceFile;
423 export function processComponentChild(node: ts.Block | ts.SourceFile, newStatements: ts.Statement[],
426 …forEachParameters: ts.NodeArray<ts.ParameterDeclaration> = undefined, isGlobalBuilder: boolean = f…
430 const compilerOptions = ts.readConfigFile(
431 path.resolve(__dirname, '../tsconfig.json'), ts.sys.readFile).config.compilerOptions;
435 …sourceNode = ts.createSourceFile('', node.getText(), ts.ScriptTarget.Latest, true, ts.ScriptKind.E…
441 if (ts.isExpressionStatement(item)) {
450 const [etsExpression, idName]: [ts.EtsComponentExpression, ts.Expression] = constant
452 if (ts.isIdentifier(etsExpression.expression)) {
460 const idName: ts.Expression = checkIdInIf(item, savedParent);
463 … if (item.expression && ts.isEtsComponentExpression(item.expression) && item.expression.body) {
464 const expressionResult: ts.ExpressionStatement =
470 processCustomComponent(item as ts.ExpressionStatement, newStatements, log, name,
512 } else if (ts.isIfStatement(item)) {
515 } else if (!ts.isBlock(item)) {
535 function assignParameter(forEachParameters: ts.NodeArray<ts.ParameterDeclaration>, item: ts.Node): …
547 export function transferBuilderCall(node: ts.ExpressionStatement, name: string,
548 isBuilder: boolean = false): ts.ExpressionStatement {
549 if (node.expression && ts.isCallExpression(node.expression)) {
550 const newNode: ts.Expression = ts.factory.createCallExpression(
551 ts.factory.createPropertyAccessExpression(
553 ts.factory.createIdentifier(BUILDER_ATTR_BIND)
556 [ts.factory.createThis()]
559 …if (node.expression.arguments && node.expression.arguments.length === 1 && ts.isObjectLiteralExpre…
560 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
563 [ts.factory.createCallExpression(
564 ts.factory.createIdentifier(BUILDER_PARAM_PROXY),
567 ts.factory.createStringLiteral(name),
573 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
578 … [...node.expression.arguments, ts.factory.createNull(), ts.factory.createIdentifier(MY_IDS)]
584 function traverseBuilderParams(node: ts.ObjectLiteralExpression,
585 isBuilder: boolean): ts.ObjectLiteralExpression {
586 const properties: ts.ObjectLiteralElementLike[] = [];
589 if (ts.isPropertyAssignment(property) && property.initializer &&
590 ts.isPropertyAccessExpression(property.initializer) && property.initializer.expression &&
591 property.initializer.name && ts.isIdentifier(property.initializer.name)) {
593 …if (!storedFileInfo.processGlobalBuilder && property.initializer.expression.kind === ts.SyntaxKind…
594 isBuilder && ts.isIdentifier(property.initializer.expression) &&
596 … const useThis: boolean = property.initializer.expression.kind === ts.SyntaxKind.ThisKeyword;
599 properties.push(ts.factory.createPropertyAssignment(
601 ts.factory.createArrowFunction(
606 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
612 properties.push(ts.factory.createPropertyAssignment(
614 ts.factory.createArrowFunction(
619 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
626 return ts.factory.createObjectLiteralExpression(properties);
629 function addProperties(properties: ts.ObjectLiteralElementLike[], property: ts.ObjectLiteralElement…
631 properties.push(ts.factory.createPropertyAssignment(
633 ts.factory.createArrowFunction(
638 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
639 ts.factory.createParenthesizedExpression(ts.factory.createConditionalExpression(
640 ts.factory.createElementAccessExpression(
641 (isBuilder && !useThis) ? ts.factory.createIdentifier($$) : ts.factory.createThis(),
642 ts.factory.createStringLiteral('__' + name)
644 ts.factory.createToken(ts.SyntaxKind.QuestionToken),
645 ts.factory.createElementAccessExpression(
646 (isBuilder && !useThis) ? ts.factory.createIdentifier($$) : ts.factory.createThis(),
647 ts.factory.createStringLiteral('__' + name)
649 ts.factory.createToken(ts.SyntaxKind.ColonToken),
650 ts.factory.createElementAccessExpression(
651 (isBuilder && !useThis) ? ts.factory.createIdentifier($$) : ts.factory.createThis(),
652 ts.factory.createStringLiteral(name)
659 function addInnerBuilderParameter(node: ts.ExpressionStatement,
660 isGlobalBuilder: boolean = false): ts.ExpressionStatement {
661 if (node.expression && ts.isCallExpression(node.expression) && node.expression.arguments) {
662 …node.expression.arguments.push(isGlobalBuilder ? parentConditionalExpression() : ts.factory.create…
663 return ts.factory.createExpressionStatement(ts.factory.updateCallExpression(node.expression,
670 function processExpressionStatementChange(node: ts.ExpressionStatement, nextNode: ts.Block,
671 log: LogInfo[]): ts.ExpressionStatement {
674 if (node.expression.expression && ts.isIdentifier(node.expression.expression)) {
691 function processBlockToExpression(node: ts.ExpressionStatement, nextNode: ts.Block,
692 log: LogInfo[], name: string): ts.ExpressionStatement {
694 const newBlock: ts.Block = processComponentBlock(nextNode, false, log);
695 const arrowNode: ts.ArrowFunction = ts.factory.createArrowFunction(undefined, undefined,
696 [], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), newBlock);
697 const newPropertyAssignment:ts.PropertyAssignment = ts.factory.createPropertyAssignment(
698 ts.factory.createIdentifier(childParam), arrowNode);
700 let argumentsArray: ts.ObjectLiteralExpression[] = node.expression.arguments;
702 argumentsArray = [ts.factory.createObjectLiteralExpression([newPropertyAssignment], true)];
704 argumentsArray = [ts.factory.createObjectLiteralExpression(
708 const callNode: ts.CallExpression = ts.factory.updateCallExpression(
716 node = ts.factory.updateExpressionStatement(node, callNode);
721 etsComponentNode: ts.EtsComponentExpression;
724 function parseEtsComponentExpression(node: ts.ExpressionStatement): EtsComponentResult {
725 let etsComponentNode: ts.EtsComponentExpression;
729 if (ts.isCallExpression(temp) && temp.expression &&
730 ts.isPropertyAccessExpression(temp.expression)) {
733 if (ts.isEtsComponentExpression(temp)) {
742 export function createCollectElmtIdNode(): ts.ExpressionStatement {
743 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
744 ts.factory.createPropertyAccessExpression(
745 ts.factory.createIdentifier(MY_IDS),
746 ts.factory.createIdentifier(PUSH)
749 [ts.factory.createIdentifier(ELMTID)]
753 function processInnerComponent(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[],
755 isTransition: boolean = false, idName: ts.Expression = undefined, savedParent: string = undefined,
757 const newStatements: ts.Statement[] = [];
761 validateEtsComponentNode(node.expression as ts.EtsComponentExpression, nameResult);
775 function processNormalComponent(node: ts.ExpressionStatement, nameResult: NameResult,
776 …innerCompStatements: ts.Statement[], log: LogInfo[], parent: string = undefined, isBuilder: boolea…
777 …isGlobalBuilder: boolean = false, isTransition: boolean = false, idName: ts.Expression = undefined,
779 const newStatements: ts.Statement[] = [];
783 const immutableStatements: ts.Statement[] = [];
793 …if (etsComponentResult.etsComponentNode.body && ts.isBlock(etsComponentResult.etsComponentNode.bod…
825 export function ifRetakeId(blockContent: ts.Statement[], idName: ts.Expression): ts.IfStatement {
826 return ts.factory.createIfStatement(
827 ts.factory.createPrefixUnaryExpression(
828 ts.SyntaxKind.ExclamationToken,
829 ts.factory.createCallExpression(
830 ts.factory.createPropertyAccessExpression(
831 ts.factory.createIdentifier(COMPONENT_IF),
832 ts.factory.createIdentifier(CAN_RETAKE)
838 ts.factory.createBlock(
846 function processDebug(node: ts.Statement, nameResult: NameResult, newStatements: ts.Statement[],
847 getNode: boolean = false): ts.ExpressionStatement {
850 let posOfNode: ts.LineAndCharacter;
878 const debugNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(
879 createFunction(ts.factory.createIdentifier(nameResult.name),
880 ts.factory.createIdentifier(COMPONENT_DEBUGLINE_FUNCTION),
881 ts.factory.createNodeArray([ts.factory.createStringLiteral(debugInfo)])));
889 function processInnerCompStatements(innerCompStatements: ts.Statement[],
890 …newStatements: ts.Statement[], node: ts.Statement, isGlobalBuilder: boolean, isTransition: boolean,
891 nameResult: NameResult, immutableStatements: ts.Statement[], componentName: string,
902 …builderParamsResult: BuilderParamsResult, isRecycleComponent: boolean = false): ts.ParameterDeclar…
903 const arrowNodes: ts.ParameterDeclaration[] = [
904 ts.factory.createParameterDeclaration(undefined, undefined,
905 ts.factory.createIdentifier(ELMTID), undefined, undefined, undefined),
906 ts.factory.createParameterDeclaration(undefined, undefined,
907 ts.factory.createIdentifier(ISINITIALRENDER), undefined, undefined, undefined)
911 const paramName: ts.Identifier = builderParamsResult.firstParam.name as ts.Identifier;
912 arrowNodes.push(ts.factory.createParameterDeclaration(undefined, undefined,
913 …paramName, undefined, undefined, ts.factory.createIdentifier(`__${paramName.escapedText.toString()…
919 export function createComponentCreationStatement(node: ts.Statement, innerStatements: ts.Statement[…
921 nameResult: NameResult = undefined, immutableStatements: ts.Statement[] = null,
922 …builderParamsResult: BuilderParamsResult = null, isRecycleComponent: boolean = false): ts.Statemen…
923 const blockArr: ts.Statement[] = [...innerStatements];
934 const creationArgs: ts.Expression[] = [
935 ts.factory.createArrowFunction(undefined, undefined,
937 undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
938 ts.factory.createBlock(blockArr, true)
942 creationArgs.push(isTransition ? ts.factory.createNull() :
943 ts.factory.createIdentifier(componentName));
945 return ts.factory.createExpressionStatement(
946 ts.factory.createCallExpression(
947 ts.factory.createPropertyAccessExpression(createConditionParent(isGlobalBuilder),
948 ts.factory.createIdentifier(partialUpdateConfig.optimizeComponent ?
954 export function createViewStackProcessorStatement(propertyAccessName: string, elmtId?: string): ts.…
955 return ts.factory.createExpressionStatement(
956 ts.factory.createCallExpression(
957 ts.factory.createPropertyAccessExpression(
958 ts.factory.createIdentifier(VIEWSTACKPROCESSOR),
959 ts.factory.createIdentifier(propertyAccessName)
962 elmtId ? [ts.factory.createIdentifier(ELMTID)] : []
967 function createInitRenderStatement(node: ts.Statement,
968 immutableStatements: ts.Statement[], blockArr: ts.Statement[]): void {
971 blockArr.push(ts.factory.createIfStatement(
972 ts.factory.createIdentifier(ISINITIALRENDER),
973 ts.factory.createBlock(immutableStatements, true)
977 blockArr.push(ts.factory.createIfStatement(
978 ts.factory.createPrefixUnaryExpression(
979 ts.SyntaxKind.ExclamationToken,
980 ts.factory.createIdentifier(ISINITIALRENDER)
982 ts.factory.createBlock(
984 ts.isExpressionStatement(node) ?
990 ts.factory.createBlock(immutableStatements, true) : undefined
995 function processItemComponent(node: ts.ExpressionStatement, nameResult: NameResult, innerCompStatem…
996 …log: LogInfo[], parent: string = undefined, isGlobalBuilder: boolean = false, idName: ts.Expressio…
998 const itemRenderInnerStatements: ts.Statement[] = [];
999 const immutableStatements: ts.Statement[] = [];
1000 const deepItemRenderInnerStatements: ts.Statement[] = [];
1006 const itemCreateStatement: ts.Statement = createItemCreate(nameResult, isLazyCreate);
1009 …if (etsComponentResult.etsComponentNode.body && ts.isBlock(etsComponentResult.etsComponentNode.bod…
1020 let generateItem: ts.IfStatement | ts.Block;
1033 function createItemCreate(nameResult: NameResult, isLazyCreate: boolean): ts.Statement {
1034 const itemCreateArgs: ts.Expression[] = [];
1036 itemCreateArgs.push(ts.factory.createIdentifier(DEEPRENDERFUNCTION), ts.factory.createTrue());
1039 ts.factory.createArrowFunction(undefined, undefined, [], undefined,
1040 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1041 ts.factory.createBlock([], false)),
1042 ts.factory.createFalse()
1046 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1047 ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(nameResult.name),
1048 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, itemCreateArgs));
1052 creationArgs: ts.Expression[],
1057 const creationArgs: ts.Expression[] = [];
1061 ts.factory.createIdentifier(ITEMCREATION2),
1062 ts.factory.createIdentifier(nameResult.name));
1065 creationArgs.push(ts.factory.createIdentifier(ITEMCREATION));
1071 node: ts.ExpressionStatement,
1072 itemRenderInnerStatements: ts.Statement[],
1073 deepItemRenderInnerStatements: ts.Statement[],
1075 immutableStatements: ts.Statement[],
1078 ): ts.Block {
1079 const blockNode: ts.Statement[] = [
1088 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1089 ts.factory.createPropertyAccessExpression(
1090 ts.factory.createThis(),
1091 ts.factory.createIdentifier(itemCreation.creationName)
1102 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1103 ts.factory.createIdentifier(OBSERVEDDEEPRENDER), undefined, []))
1106 return ts.factory.createBlock(blockNode, true);
1109 function checkLazyCreate(node: ts.ExpressionStatement, nameResult: NameResult): boolean {
1111 if (nameResult.arguments.length && ts.isStringLiteral(nameResult.arguments[0]) &&
1123 function createItemCreation(node: ts.ExpressionStatement, isGlobalBuilder: boolean,
1124 builderParamsResult: BuilderParamsResult): ts.VariableStatement {
1125 return ts.factory.createVariableStatement(
1127 ts.factory.createVariableDeclarationList(
1128 [ts.factory.createVariableDeclaration(
1129 ts.factory.createIdentifier(ITEMCREATION), undefined, undefined,
1130 ts.factory.createArrowFunction(undefined, undefined,
1132 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1133 ts.factory.createBlock(
1136 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1137 ts.factory.createIdentifier(ITEMCREATION2),
1140 ts.factory.createIfStatement(
1141 ts.factory.createPrefixUnaryExpression(
1142 ts.SyntaxKind.ExclamationToken,
1143 ts.factory.createIdentifier(ISINITIALRENDER)
1145 ts.factory.createBlock(
1156 ts.NodeFlags.Const
1162 node: ts.ExpressionStatement,
1163 itemRenderInnerStatements: ts.Statement[],
1165 immutableStatements: ts.Statement[],
1168 ): ts.VariableStatement {
1169 const itemBlock: ts.Statement[] = [
1174 itemBlock.push(ts.factory.createIfStatement(
1175 ts.factory.createIdentifier(ISINITIALRENDER),
1176 ts.factory.createBlock(immutableStatements, true)
1179 return ts.factory.createVariableStatement(
1181 ts.factory.createVariableDeclarationList(
1182 [ts.factory.createVariableDeclaration(
1183 ts.factory.createIdentifier(ITEMCREATION2), undefined, undefined,
1184 ts.factory.createArrowFunction(undefined, undefined,
1186 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1187 ts.factory.createBlock(itemBlock, true)
1190 ts.NodeFlags.Const
1196 builderParamsResult: BuilderParamsResult): ts.Expression[] {
1197 const itemCreationArgs: ts.Expression[] = [
1198 ts.factory.createIdentifier(ELMTID), ts.factory.createIdentifier(ISINITIALRENDER)];
1201 itemCreationArgs.push(builderParamsResult.firstParam.name as ts.Identifier);
1207 node: ts.ExpressionStatement,
1208 deepItemRenderInnerStatements: ts.Statement[],
1211 ): ts.VariableStatement {
1212 const blockNode: ts.Statement[] = [
1213 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1214 ts.factory.createIdentifier(ITEMCREATION), undefined,
1217 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1218 ts.factory.createPropertyAccessExpression(
1219 ts.factory.createPropertyAccessExpression(
1220 ts.factory.createThis(),
1221 ts.factory.createIdentifier(UPDATE_FUNC_BY_ELMT_ID)
1223 ts.factory.createIdentifier(CREATE_SET_METHOD)
1225 [ts.factory.createIdentifier(ELMTID), ts.factory.createIdentifier(ITEMCREATION)]
1233 return ts.factory.createVariableStatement(
1235 ts.factory.createVariableDeclarationList(
1236 [ts.factory.createVariableDeclaration(
1237 ts.factory.createIdentifier(DEEPRENDERFUNCTION), undefined, undefined,
1238 ts.factory.createArrowFunction(undefined, undefined,
1240 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1241 ts.factory.createBlock(blockNode, true)
1244 ts.NodeFlags.Const
1250 node: ts.ExpressionStatement,
1251 deepItemRenderInnerStatements: ts.Statement[],
1253 ): ts.VariableStatement {
1254 return ts.factory.createVariableStatement(
1256 ts.factory.createVariableDeclarationList(
1257 [ts.factory.createVariableDeclaration(
1258 ts.factory.createIdentifier(OBSERVEDDEEPRENDER),
1261 ts.factory.createArrowFunction(
1266 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1267 ts.factory.createBlock(
1269 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1270 ts.factory.createPropertyAccessExpression(
1271 ts.factory.createThis(),
1272 ts.factory.createIdentifier(itemCreation.creationName)
1282 ts.NodeFlags.Const
1287 function processTabAndNav(node: ts.ExpressionStatement, innerCompStatements: ts.Statement[],
1289 idName: ts.Expression = undefined, builderParamsResult: BuilderParamsResult = null): void {
1291 const TabContentComp: ts.EtsComponentExpression = getEtsComponentExpression(node);
1292 const TabContentBody: ts.Block = TabContentComp.body;
1293 let tabContentCreation: ts.Statement;
1294 …const tabContentPop: ts.Statement = ts.factory.createExpressionStatement(ts.factory.createCallExpr…
1295 ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(name),
1296 ts.factory.createIdentifier(COMPONENT_POP_FUNCTION)), undefined, []));
1297 const tabAttrs: ts.Statement[] = [];
1301 const immutableStatements: ts.Statement[] = [];
1307 const newTabContentChildren: ts.Statement[] = [];
1310 tabContentCreation = ts.factory.createExpressionStatement(
1311 ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(
1312 ts.factory.createIdentifier(name), ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)),
1313 undefined, [ts.factory.createArrowFunction(undefined, undefined, [], undefined,
1314 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1315 ts.factory.createBlock([...newTabContentChildren], true))]));
1316 …bindComponentAttr(node, ts.factory.createIdentifier(name), tabAttrs, log, true, false, immutableSt…
1322 tabContentCreation = ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1323 ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(name),
1324 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, []));
1325 …bindComponentAttr(node, ts.factory.createIdentifier(name), tabAttrs, log, true, false, immutableSt…
1337 export function getRealNodePos(node: ts.Node): number {
1347 function processForEachComponent(node: ts.ExpressionStatement, newStatements: ts.Statement[],
1349 const popNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(createFunction(
1351 node.expression.expression as ts.Identifier,
1352 ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null));
1353 if (ts.isCallExpression(node.expression)) {
1354 const propertyNode: ts.PropertyAccessExpression = ts.factory.createPropertyAccessExpression(
1355 node.expression.expression as ts.Identifier,
1356 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)
1358 const argumentsArray: ts.Expression[] = Array.from(node.expression.arguments);
1359 let arrayObserveredObject: ts.CallExpression;
1361 arrayObserveredObject = ts.factory.createCallExpression(
1362ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(FOREACH_OBSERVED_OBJECT),
1363 ts.factory.createIdentifier(FOREACH_GET_RAW_OBJECT)), undefined, [argumentsArray[0]]);
1366 const newForEachArrowFunc: ts.ArrowFunction = processForEachFunctionBlock(node.expression);
1367 const newArrowNode: ts.ArrowFunction =
1368 … processForEachBlock(node.expression, log, newForEachArrowFunc, isBuilder, ) as ts.ArrowFunction;
1372 node = addForEachId(ts.factory.updateExpressionStatement(node, ts.factory.updateCallExpression(
1378 function processForEachComponentNew(node: ts.ExpressionStatement, newStatements: ts.Statement[],
1380 const newForEachStatements: ts.Statement[] = [];
1381 const popNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(createFunction(
1382 (node.expression as ts.CallExpression).expression as ts.Identifier,
1383 ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null));
1384 if (ts.isCallExpression(node.expression)) {
1390 const argumentsArray: ts.Expression[] = Array.from(node.expression.arguments);
1391 const propertyNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(
1392 ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(
1393 node.expression.expression as ts.Identifier,
1394 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)), undefined, []));
1395 const newForEachArrowFunc: ts.ArrowFunction = processForEachFunctionBlock(node.expression);
1396 const newArrowNode: ts.NodeArray<ts.Statement> =
1398 builderParamsResult) as ts.NodeArray<ts.Statement>;
1399 …const itemGenFunctionStatement: ts.VariableStatement = createItemGenFunctionStatement(node.express…
1400 …const itemIdFuncStatement: ts.VariableStatement = createItemIdFuncStatement(node.expression, argum…
1401 …const updateFunctionStatement: ts.ExpressionStatement = createUpdateFunctionStatement(argumentsArr…
1402 const lazyForEachStatement: ts.ExpressionStatement = createLazyForEachStatement(argumentsArray);
1409 …newStatements.push(ts.factory.createBlock([itemGenFunctionStatement, itemIdFuncStatement, lazyForE…
1412 …newStatements.push(ts.factory.createBlock([itemGenFunctionStatement, lazyForEachStatement, popNode…
1423 function checkForEachComponent(node: ts.ExpressionStatement): boolean {
1424 return node.expression.expression && ts.isIdentifier(node.expression.expression) &&
1429 node: ts.CallExpression,
1430 newArrowNode: ts.NodeArray<ts.Statement>,
1431 newForEachArrowFunc: ts.ArrowFunction
1432 ): ts.VariableStatement {
1433 if (newForEachArrowFunc && ts.isArrowFunction(newForEachArrowFunc)) {
1434 return ts.factory.createVariableStatement(
1436 ts.factory.createVariableDeclarationList(
1437 [ts.factory.createVariableDeclaration(
1438 ts.factory.createIdentifier(node.expression.getText() === COMPONENT_FOREACH ?
1441 ts.factory.createArrowFunction(
1445 undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1446 ts.factory.createBlock(
1455 ts.NodeFlags.Const
1461 …n isForEachItemGeneratorParam(argumentsArray: ts.Expression, newArrowNode: ts.NodeArray<ts.Stateme…
1462 const createVariableStatementNode: ts.Statement[] = [];
1463 createVariableStatementNode.push(ts.factory.createVariableStatement(
1465 ts.factory.createVariableDeclarationList(
1466 [ts.factory.createVariableDeclaration(
1467 ts.factory.createIdentifier(
1471 ts.factory.createIdentifier(_ITEM)
1473 ts.NodeFlags.Const
1482 function getParameters(node: ts.ArrowFunction): ts.ParameterDeclaration[] {
1483 const parameterArr: ts.ParameterDeclaration[] = [
1484 ts.factory.createParameterDeclaration(
1485 undefined, undefined, ts.factory.createIdentifier(_ITEM))
1492 parameterArr.push(ts.factory.createParameterDeclaration(
1493 undefined, undefined, ts.factory.createIdentifier(INDEX)));
1496 ts.factory.createParameterDeclaration(
1497 undefined, undefined, ts.factory.createIdentifier(IS_INITIAL_ITEM)),
1498 ts.factory.createParameterDeclaration(
1499 undefined, undefined, ts.factory.createIdentifier(IDS))
1506 node: ts.CallExpression,
1507 argumentsArray: ts.Expression[]
1508 ): ts.VariableStatement {
1510 return ts.factory.createVariableStatement(
1512 ts.factory.createVariableDeclarationList(
1513 [ts.factory.createVariableDeclaration(
1514 ts.factory.createIdentifier(node.expression.getText() === COMPONENT_FOREACH ?
1518 ts.NodeFlags.Const
1524 function createUpdateFunctionStatement(argumentsArray: ts.Expression[],
1525 newForEachArrowFunc: ts.ArrowFunction, isGlobalBuilder: boolean = false): ts.ExpressionStatement {
1526 return ts.factory.createExpressionStatement(
1527 ts.factory.createCallExpression(
1528 ts.factory.createPropertyAccessExpression(
1529 isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis(),
1530 ts.factory.createIdentifier(FOREACHUPDATEFUNCTION)
1538 …tion addForEachIdFuncParameter(argumentsArray: ts.Expression[], newForEachArrowFunc: ts.ArrowFunct…
1539 const addForEachIdFuncParameterArr: ts.Expression[] = [];
1541 ts.factory.createIdentifier(ELMTID),
1543 ts.factory.createIdentifier(FOREACHITEMGENFUNCTION)
1548 …addForEachIdFuncParameterArr.push(...addForEachParameter(ts.factory.createIdentifier(COMPONENT_IF_…
1567 …n addForEachParameter(forEachItemIdContent: ts.Expression, forEachItemGen: string, forEachItemId: …
1568 return [forEachItemIdContent, ts.factory.createIdentifier(forEachItemGen),
1569 ts.factory.createIdentifier(forEachItemId)];
1572 function createLazyForEachStatement(argumentsArray: ts.Expression[]): ts.ExpressionStatement {
1573 const parameterList: ts.Expression[] = [
1574 ts.factory.createStringLiteral(componentInfo.id.toString()),
1575 ts.factory.createThis(),
1577 ts.factory.createIdentifier(__LAZYFOREACHITEMGENFUNCTION)
1580 parameterList.push(ts.factory.createIdentifier(__LAZYFOREACHITEMIDFUNC));
1583 parameterList.push(ts.factory.createTrue());
1585 return ts.factory.createExpressionStatement(
1586 ts.factory.createCallExpression(
1587 ts.factory.createPropertyAccessExpression(
1588 ts.factory.createIdentifier(COMPONENT_LAZYFOREACH),
1589 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION)
1597 function addForEachId(node: ts.ExpressionStatement, isGlobalBuilder: boolean = false): ts.Expressio…
1598 const forEachComponent: ts.CallExpression = node.expression as ts.CallExpression;
1599 return ts.factory.updateExpressionStatement(node, ts.factory.updateCallExpression(
1601 [ts.factory.createStringLiteral((++componentInfo.id).toString()),
1602 isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis(),
1606 export function parentConditionalExpression(): ts.ConditionalExpression {
1607 return ts.factory.createConditionalExpression(
1608 ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
1609 ts.factory.createToken(ts.SyntaxKind.QuestionToken),
1610 ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
1611 ts.factory.createToken(ts.SyntaxKind.ColonToken),
1612 ts.factory.createThis());
1614 function processForEachFunctionBlock(node: ts.CallExpression): ts.ArrowFunction {
1615 if (ts.isArrowFunction(node.arguments[1])) {
1617 …} else if (ts.isParenthesizedExpression(node.arguments[1]) && ts.isArrowFunction(node.arguments[1]…
1623 function processForEachBlock(node: ts.CallExpression, log: LogInfo[],
1624 arrowNode: ts.ArrowFunction, isBuilder: boolean = false, isGlobalBuilder: boolean = false,
1625 builderParamsResult: BuilderParamsResult = null): ts.NodeArray<ts.Statement> | ts.ArrowFunction {
1626 if (node.arguments.length > 1 && ts.isArrowFunction(arrowNode)) {
1628 const body: ts.ConciseBody = arrowNode.body;
1629 if (!ts.isBlock(body)) {
1630 const statement: ts.Statement = ts.factory.createExpressionStatement(body);
1631 const blockNode: ts.Block = ts.factory.createBlock([statement], true);
1635 return ts.factory.updateArrowFunction(
1636 arrowNode, ts.getModifiers(arrowNode), arrowNode.typeParameters, arrowNode.parameters,
1646 return ts.factory.updateArrowFunction(
1647 arrowNode, ts.getModifiers(arrowNode), arrowNode.typeParameters, arrowNode.parameters,
1659 function createRenderingInProgress(isTrue: boolean): ts.ExpressionStatement {
1660 return ts.factory.createExpressionStatement(ts.factory.createBinaryExpression(
1661 ts.factory.createPropertyAccessExpression(
1662 ts.factory.createThis(),
1663 ts.factory.createIdentifier(IS_RENDERING_IN_PROGRESS)
1665 ts.factory.createToken(ts.SyntaxKind.EqualsToken),
1666 isTrue ? ts.factory.createTrue() : ts.factory.createFalse()
1675 function processIfStatement(node: ts.IfStatement, newStatements: ts.Statement[],
1678 const ifStatements: ts.Statement[] = [];
1683 const ifCreate: ts.ExpressionStatement = createIfCreate();
1684 …const newIfNode: ts.IfStatement = processInnerIfStatement(node, 0, log, isBuilder, isGlobalBuilder…
1686 const ifPop: ts.ExpressionStatement = createIfPop();
1695 function processInnerIfStatement(node: ts.IfStatement, id: number, log: LogInfo[],
1697 builderParamsResult: BuilderParamsResult = null): ts.IfStatement {
1698 if (ts.isIdentifier(node.expression) && node.expression.originalKeywordKind === undefined &&
1705 node = ts.factory.updateIfStatement(node, ts.factory.createIdentifier(COMPONENT_IF_UNDEFINED),
1708 …const newThenStatement: ts.Statement = processThenStatement(node.thenStatement, id, log, isBuilder…
1709 …const newElseStatement: ts.Statement = processElseStatement(node.elseStatement, id, log, isBuilder…
1710 const newIfNode: ts.IfStatement = ts.factory.updateIfStatement(
1715 function processThenStatement(thenStatement: ts.Statement, id: number,
1717 builderParamsResult: BuilderParamsResult = null): ts.Statement {
1718 if (ts.isExpressionStatement(thenStatement) && ts.isIdentifier(thenStatement.expression) &&
1728 if (ts.isBlock(thenStatement)) {
1730 } else if (ts.isIfStatement(thenStatement)) {
1732 thenStatement = ts.factory.createBlock(
1739 thenStatement = ts.factory.createBlock([thenStatement], true);
1740 …thenStatement = processIfBlock(thenStatement as ts.Block, id, log, isBuilder, isGlobalBuilder, bui…
1746 function processElseStatement(elseStatement: ts.Statement, id: number,
1748 builderParamsResult: BuilderParamsResult = null): ts.Statement {
1750 if (ts.isBlock(elseStatement)) {
1752 } else if (ts.isIfStatement(elseStatement)) {
1755 elseStatement = ts.factory.createBlock([elseStatement], true);
1756 …elseStatement = processIfBlock(elseStatement as ts.Block, id + 1, log, isBuilder, isGlobalBuilder,…
1759 elseStatement = ts.factory.createBlock([
1760 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
1761 ts.factory.createPropertyAccessExpression(
1762 ts.factory.createThis(),
1763 ts.factory.createIdentifier(IFELSEBRANCHUPDATEFUNCTION)
1767 ts.factory.createNumericLiteral(++id),
1768 ts.factory.createArrowFunction(
1773 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1774 ts.factory.createBlock(
1786 function processIfBlock(block: ts.Block, id: number, log: LogInfo[], isBuilder: boolean = false,
1787 isGlobalBuilder: boolean = false, builderParamsResult: BuilderParamsResult = null): ts.Block {
1792 function addIfBranchId(id: number, isGlobalBuilder: boolean = false, container: ts.Block): ts.Block…
1793 let containerStatements: ts.Statement[];
1799 return ts.factory.updateBlock(container, containerStatements);
1802 function createIf(): ts.Identifier {
1803 return ts.factory.createIdentifier(COMPONENT_IF);
1806 function createIfCreate(): ts.ExpressionStatement {
1807 return ts.factory.createExpressionStatement(createFunction(createIf(),
1808 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), ts.factory.createNodeArray([])));
1811 function createIfPop(): ts.ExpressionStatement {
1812 return ts.factory.createExpressionStatement(createFunction(createIf(),
1813 ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null));
1816 function createIfBranchId(id: number): ts.ExpressionStatement {
1817 return ts.factory.createExpressionStatement(createFunction(createIf(),
1818 ts.factory.createIdentifier(COMPONENT_IF_BRANCH_ID_FUNCTION),
1819 ts.factory.createNodeArray([ts.factory.createNumericLiteral(id)])));
1822 function createIfBranchFunc(id: number, innerStatements: ts.Statement[],
1823 isGlobalBuilder: boolean = false): ts.ExpressionStatement {
1824 …return ts.factory.createExpressionStatement(ts.factory.createCallExpression(ts.factory.createPrope…
1825 isGlobalBuilder ? parentConditionalExpression() : ts.factory.createThis(),
1826 ts.factory.createIdentifier(IFELSEBRANCHUPDATEFUNCTION)), undefined,
1827 …[ts.factory.createNumericLiteral(id), ts.factory.createArrowFunction(undefined, undefined, [], und…
1828ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createBlock(innerStatemen…
1832 newNode: ts.ExpressionStatement;
1833 identifierNode: ts.Identifier;
1839 function createComponent(node: ts.ExpressionStatement, type: string): CreateResult {
1847 let identifierNode: ts.Identifier = ts.factory.createIdentifier(type);
1849 while (temp && !ts.isIdentifier(temp) && temp.expression) {
1852 if (temp && temp.parent && (ts.isCallExpression(temp.parent) ||
1853 ts.isEtsComponentExpression(temp.parent)) && ts.isIdentifier(temp)) {
1857 ? ts.factory.createIdentifier(COMPONENT_CREATE_CHILD_FUNCTION)
1858 : ts.factory.createIdentifier(COMPONENT_CREATE_LABEL_FUNCTION);
1867 ? ts.factory.createExpressionStatement(createFunction(temp, identifierNode, null))
1868 …: ts.factory.createExpressionStatement(createFunction(temp, identifierNode, checkArguments(temp, t…
1874 function checkArguments(temp: ts.Identifier, type: string): ts.Expression[] {
1875 const newArguments: ts.Expression[] = [];
1878 if (ts.isConditionalExpression(argument)) {
1892 ts.factory.createStringLiteral(`${projectConfig.bundleName}/${projectConfig.moduleName}`)
1896 function checkContainer(name: string, node: ts.Node): boolean {
1899 ts.isObjectLiteralExpression(node.arguments[0]) && node.arguments[0].properties &&
1903 function checkComponentType(properties: ts.PropertyAssignment[]): boolean {
1913 function isXComponentContainer(item: ts.PropertyAssignment): boolean {
1914 return item.name && ts.isIdentifier(item.name) && item.name.getText() === RESOURCE_NAME_TYPE &&
1915 item.initializer && ((ts.isStringLiteral(item.initializer) &&
1920 (ts.isNumericLiteral(item.initializer) && item.initializer.getText() === '1') ||
1922 (ts.isPropertyAccessExpression(item.initializer) && item.initializer.expression &&
1923 ts.isIdentifier(item.initializer.expression) && item.initializer.name &&
1924ts.isIdentifier(item.initializer.name) && item.initializer.expression.getText() === XCOMPONENTTYPE…
1929 statement: ts.Statement,
1935 reuseId: ts.Node
1938 export function bindComponentAttr(node: ts.ExpressionStatement, identifierNode: ts.Identifier,
1939 newStatements: ts.Statement[], log: LogInfo[], reverse: boolean = true,
1940 isStylesAttr: boolean = false, newImmutableStatements: ts.Statement[] = null,
1943 const statements: ts.Statement[] = [];
1944 const immutableStatements: ts.Statement[] = [];
1945 const updateStatements: ts.Statement[] = [];
1952 if (ts.isPropertyAccessExpression(temp)) {
1959 while (temp && ts.isCallExpression(temp) && temp.expression) {
1964 if (ts.isIdentifier(temp.expression)) {
1966 } else if (ts.isPropertyAccessExpression(temp.expression)) {
1981 if (ts.isPropertyAccessExpression(temp.expression) &&
1982 temp.expression.name && ts.isIdentifier(temp.expression.name) &&
1990 } else if (ts.isIdentifier(temp.expression)) {
2022 function parseRecycleId(node: ts.CallExpression, attr: ts.Identifier, isRecycleComponent: boolean,
2029 function processCustomBuilderProperty(node: ts.CallExpression, identifierNode: ts.Identifier,
2030 propertyName: string): ts.CallExpression {
2031 const newArguments: ts.Expression[] = [];
2032 node.arguments.forEach((argument: ts.Expression | ts.Identifier, index: number) => {
2033 if (ts.isConditionalExpression(argument)) {
2041 node = ts.factory.updateCallExpression(node, node.expression, node.typeArguments, newArguments);
2045 function isBuilderChangeNode(argument: ts.Node, identifierNode: ts.Identifier, propertyName: string…
2046 …return ts.isPropertyAccessExpression(argument) && argument.name && ts.isIdentifier(argument.name) …
2048 ts.isCallExpression(argument) && argument.expression && argument.expression.name &&
2049 ts.isIdentifier(argument.expression.name) &&
2050 …storedFileInfo.builderLikeCollection.has(argument.expression.name.getText()) || ts.isIdentifier(ar…
2052ts.isObjectLiteralExpression(argument) && (BIND_OBJECT_PROPERTY.get(identifierNode.escapedText.toS…
2055 ts.isCallExpression(argument) && argument.expression && ts.isIdentifier(argument.expression) &&
2057 …isWrappedBuilder(argument as ts.PropertyAccessExpression) || isWrappedBuilderCallExpression(argume…
2060 export function isWrappedBuilder(node: ts.PropertyAccessExpression): boolean {
2061 if (projectConfig.minAPIVersion >= 11 && ts.isPropertyAccessExpression(node) &&
2062 …node.name && ts.isIdentifier(node.name) && node.name.escapedText.toString() === WRAPBUILDER_BUILDE…
2071 function isWrappedBuilderCallExpression(node: ts.CallExpression): boolean {
2072 if (projectConfig.minAPIVersion >= 11 && ts.isCallExpression(node) && node.expression &&
2073 isWrappedBuilder(node.expression as ts.PropertyAccessExpression)) {
2079 function parseBuilderNode(node: ts.Node, propertyName: string):
2080 ts.ObjectLiteralExpression | ts.CallExpression | ts.ArrowFunction {
2081 …if (isWrappedBuilder(node as ts.PropertyAccessExpression) || isPropertyAccessExpressionNode(node))…
2083 return processPropertyBuilderWithoutKey(node as ts.PropertyAccessExpression);
2085 return processPropertyBuilder(node as ts.PropertyAccessExpression);
2087 …} else if (ts.isIdentifier(node) && storedFileInfo.builderLikeCollection.has(node.escapedText.toSt…
2093 …} else if (isWrappedBuilderCallExpression(node as ts.CallExpression) || ts.isCallExpression(node))…
2099 } else if (ts.isObjectLiteralExpression(node)) {
2104 export function processObjectPropertyBuilder(node: ts.ObjectLiteralExpression): ts.ObjectLiteralExp…
2105 const newProperties: ts.PropertyAssignment[] = [];
2106 node.properties.forEach((property: ts.PropertyAssignment) => {
2107 if (property.name && ts.isIdentifier(property.name) &&
2110 …if (isPropertyAccessExpressionNode(property.initializer) || ts.isIdentifier(property.initializer) …
2112 newProperties.push(ts.factory.updatePropertyAssignment(property, property.name,
2113 ts.factory.createCallExpression(
2114 ts.factory.createPropertyAccessExpression(
2116 ts.factory.createIdentifier(BUILDER_ATTR_BIND)
2119 [ts.factory.createThis()]
2124 } else if (ts.isObjectLiteralExpression(property.initializer)) {
2125 newProperties.push(ts.factory.updatePropertyAssignment(property, property.name,
2134 return ts.factory.updateObjectLiteralExpression(node, newProperties);
2137 function trans$$inCustomBuilder(node: ts.CallExpression): ts.Expression[] {
2139 if (node.expression && ts.isIdentifier(node.expression)) {
2141 } else if (node.expression && ts.isPropertyAccessExpression(node.expression) &&
2142 node.expression.name && ts.isIdentifier(node.expression.name)) {
2145 if (node.arguments.length === 1 && ts.isObjectLiteralExpression(node.arguments[0])) {
2146 return [ts.factory.createCallExpression(
2147 ts.factory.createIdentifier(BUILDER_PARAM_PROXY),
2150 ts.factory.createStringLiteral(name),
2159 function transformBuilderCallExpression(property: ts.PropertyAssignment): ts.PropertyAssignment {
2160 …const newArguments: ts.Expression[] = trans$$inCustomBuilder(property.initializer as ts.CallExpres…
2161 return ts.factory.updatePropertyAssignment(property, property.name,
2162 ts.factory.createCallExpression(
2163 ts.factory.createPropertyAccessExpression(
2165 ts.factory.createIdentifier(BUILDER_ATTR_BIND)
2168 [ts.factory.createThis(), ...(newArguments || [])]
2172 function isInnerBuilderCallExpressionNode(node: ts.Node): boolean {
2173 …return ts.isCallExpression(node) && node.expression && isPropertyAccessExpressionNode(node.express…
2176 function isGlobalBuilderCallExpressionNode(node: ts.Node): boolean {
2177 return ts.isCallExpression(node) && node.expression && ts.isIdentifier(node.expression) &&
2181 function isPropertyAccessExpressionNode(node: ts.Node): boolean {
2182 return ts.isPropertyAccessExpression(node) && node.expression &&
2183 node.expression.kind === ts.SyntaxKind.ThisKeyword && node.name && ts.isIdentifier(node.name) &&
2187 function processBindPopupBuilder(node: ts.CallExpression): ts.CallExpression {
2188 const newArguments: ts.Expression[] = [];
2189 node.arguments.forEach((argument: ts.ObjectLiteralExpression, index: number) => {
2190 if (index === 1 && ts.isObjectLiteralExpression(argument)) {
2197 node = ts.factory.updateCallExpression(node, node.expression, node.typeArguments, newArguments);
2201 function processDragStartBuilder(node: ts.CallExpression, propertyName: string): ts.CallExpression {
2202 const newStatements: ts.Statement[] = [];
2207 const statement: ts.Statement = node.arguments[0].body.statements[i];
2210 …node = ts.factory.updateCallExpression(node, node.expression, node.typeArguments, [ts.factory.upda…
2214 …node.arguments[0].equalsGreaterThanToken, ts.factory.updateBlock(node.arguments[0].body, newStatem…
2219 function isNodeFunction(node: ts.CallExpression): boolean {
2220 …return node.arguments && node.arguments.length && ts.isArrowFunction(node.arguments[0]) && node.ar…
2221 ts.isBlock(node.arguments[0].body);
2224 function checkStatement(statement: ts.Statement, propertyName: string): ts.Statement {
2225 if (ts.isReturnStatement(statement)) {
2226 if (ts.isObjectLiteralExpression(statement.expression)) {
2227 const newProperties: ts.ObjectLiteralElementLike[] = [];
2229 let property: ts.ObjectLiteralElementLike = statement.expression.properties[j];
2233 … return ts.factory.createReturnStatement(ts.factory.createObjectLiteralExpression(newProperties));
2235 let initializer: ts.Expression = statement.expression;
2237 return ts.factory.updateReturnStatement(statement, initializer);
2244 function checkProperty(property: ts.ObjectLiteralElementLike, propertyName: string): ts.ObjectLiter…
2246 let initializer: ts.Expression = property.initializer;
2248 property = ts.factory.createPropertyAssignment(property.name, initializer);
2253 function processInitializer(initializer: ts.Expression, propertyName: string): ts.Expression {
2254 if (initializer && ts.isConditionalExpression(initializer)) {
2255 …return processConditionalBuilder(initializer, ts.factory.createIdentifier(CUSTOM_COMPONENT_DEFAULT…
2257 } else if (isBuilderChangeNode(initializer, ts.factory.createIdentifier(CUSTOM_COMPONENT_DEFAULT),
2264 function isPropertyFunction(property: ts.ObjectLiteralElementLike): boolean {
2265 return ts.isPropertyAssignment(property) && property.name && ts.isIdentifier(property.name) &&
2269 function processBindPopupBuilderProperty(node: ts.ObjectLiteralExpression): ts.ObjectLiteralExpress…
2270 const newProperties: ts.PropertyAssignment[] = [];
2271 node.properties.forEach((property: ts.PropertyAssignment, index: number) => {
2272 if (property.name && ts.isIdentifier(property.name) && property.initializer &&
2274 let initializer: ts.Expression = property.initializer;
2276 newProperties.push(ts.factory.updatePropertyAssignment(property, property.name, initializer));
2281 return ts.factory.updateObjectLiteralExpression(node, newProperties);
2284 function processConditionalBuilder(initializer: ts.ConditionalExpression, identifierNode: ts.Identi…
2285 propertyName: string): ts.ConditionalExpression {
2286 let whenTrue: ts.Expression = initializer.whenTrue;
2287 let whenFalse: ts.Expression = initializer.whenFalse;
2294 return ts.factory.createConditionalExpression(
2303 function processPropertyBuilder(node: ts.PropertyAccessExpression): ts.ObjectLiteralExpression {
2304 return ts.factory.createObjectLiteralExpression([
2305 ts.factory.createPropertyAssignment(
2306 ts.factory.createIdentifier(BUILDER_ATTR_NAME),
2307 ts.factory.createCallExpression(
2308 ts.factory.createPropertyAccessExpression(
2310 ts.factory.createIdentifier(BUILDER_ATTR_BIND)
2313 [ts.factory.createThis()]
2319 function processPropertyBuilderWithoutKey(node: ts.PropertyAccessExpression): ts.CallExpression {
2320 return ts.factory.createCallExpression(
2321 ts.factory.createPropertyAccessExpression(
2323 ts.factory.createIdentifier(BUILDER_ATTR_BIND)
2326 [ts.factory.createThis()]
2330 function processIdentifierBuilder(node: ts.Identifier): ts.ObjectLiteralExpression {
2331 return ts.factory.createObjectLiteralExpression([
2332 ts.factory.createPropertyAssignment(
2333 ts.factory.createIdentifier(BUILDER_ATTR_NAME),
2334 ts.factory.createCallExpression(
2335ts.factory.createPropertyAccessExpression(node, ts.factory.createIdentifier(BUILDER_ATTR_BIND)),
2336 undefined, [ts.factory.createThis()]
2342 function processIdentifierBuilderWithoutKey(node: ts.Identifier): ts.CallExpression {
2343 return ts.factory.createCallExpression(
2344 ts.factory.createPropertyAccessExpression(node, ts.factory.createIdentifier(BUILDER_ATTR_BIND)),
2345 undefined, [ts.factory.createThis()]
2349 function getParsedBuilderAttrArgumentWithParams(node: ts.CallExpression):
2350 ts.ObjectLiteralExpression {
2351 const newArguments: ts.Expression[] = trans$$inCustomBuilder(node);
2352 return ts.factory.createObjectLiteralExpression([
2353 ts.factory.createPropertyAssignment(
2354 ts.factory.createIdentifier(BUILDER_ATTR_NAME),
2355 ts.factory.createArrowFunction(
2360 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
2361 ts.factory.createBlock(
2362 [ts.factory.createExpressionStatement(ts.factory.createCallExpression(
2363ts.factory.createPropertyAccessExpression(node.expression, ts.factory.createIdentifier(CALL)
2364 ), undefined, [ts.factory.createThis(), ...newArguments]))],
2372 function getParsedBuilderAttrArgumentWithParamsWithoutKey(node: ts.CallExpression):
2373 ts.ArrowFunction {
2374 const newArguments: ts.Expression[] = trans$$inCustomBuilder(node);
2375 return ts.factory.createArrowFunction(
2380 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
2381 ts.factory.createBlock(
2382 [ts.factory.createExpressionStatement(ts.factory.createCallExpression(
2383 ts.factory.createPropertyAccessExpression(node.expression, ts.factory.createIdentifier(CALL)
2384 ), undefined, [ts.factory.createThis(), ...newArguments]))],
2390 function validatePropertyAccessExpressionWithCustomBuilder(node: ts.Node): boolean {
2391 return ts.isPropertyAccessExpression(node) && node.name &&
2392 ts.isIdentifier(node.name) && CUSTOM_BUILDER_PROPERTIES.has(node.name.escapedText.toString());
2395 function validateIdentifierWithCustomBuilder(node: ts.Node): boolean {
2396 return ts.isIdentifier(node) && CUSTOM_BUILDER_PROPERTIES.has(node.escapedText.toString());
2399 function createArrowFunctionFor$$($$varExp: ts.Expression): ts.ArrowFunction {
2400 return ts.factory.createArrowFunction(
2402 [ts.factory.createParameterDeclaration(
2404 ts.factory.createIdentifier($$_NEW_VALUE),
2408 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
2409 ts.factory.createBlock(
2410 [ts.factory.createExpressionStatement(ts.factory.createBinaryExpression(
2412 ts.factory.createToken(ts.SyntaxKind.EqualsToken),
2413 ts.factory.createIdentifier($$_NEW_VALUE)
2420 function updateArgumentFor$$(argument): ts.Expression {
2421 if (ts.isElementAccessExpression(argument)) {
2422 return ts.factory.updateElementAccessExpression(
2424 } else if (ts.isIdentifier(argument)) {
2426 return ts.factory.createThis();
2428 return ts.factory.createIdentifier(argument.getText().replace(/\$\$/, ''));
2430 } else if (ts.isPropertyAccessExpression(argument)) {
2431 return ts.factory.updatePropertyAccessExpression(
2437 function verifyComponentId(temp: any, node: ts.Identifier, propName: string,
2440 ts.isStringLiteral(temp.arguments[0])) {
2442 const posOfNode: ts.LineAndCharacter = transformLog.sourceFile
2469 function addComponentAttr(temp: any, node: ts.Identifier, lastStatement: any,
2470 statements: ts.Statement[], identifierNode: ts.Identifier, log: LogInfo[],
2471 isStylesAttr: boolean, immutableStatements: ts.Statement[], updateStatements: ts.Statement[],
2472 newImmutableStatements: ts.Statement[] = null, isRecycleComponent: boolean = false,
2478 const animationNullNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(
2479 createFunction(ts.factory.createIdentifier(GLOBAL_CONTEXT), node,
2481 [ts.factory.createNull()]));
2484 temp.arguments[0].kind === ts.SyntaxKind.NullKeyword)) {
2490 lastStatement.statement = ts.factory.createExpressionStatement(createFunction(
2491 ts.factory.createIdentifier(GLOBAL_CONTEXT), node, temp.arguments));
2511 const extendNode: ts.Statement = ts.factory.createExpressionStatement(
2512 ts.factory.createCallExpression(ts.factory.createIdentifier(functionName), undefined,
2516 ...temp.arguments, ts.factory.createIdentifier(ELMTID),
2517 ts.factory.createIdentifier(ISINITIALRENDER),
2518 ts.factory.createThis()
2525 if (temp.arguments.length === 1 && ts.isObjectLiteralExpression(temp.arguments[0])) {
2537 const styleBlock: ts.Block =
2540 bindComponentAttr(styleBlock.statements[0] as ts.ExpressionStatement, identifierNode,
2543 bindComponentAttr(styleBlock.statements[0] as ts.ExpressionStatement, identifierNode,
2549 const argumentsArr: ts.Expression[] = [];
2551 const doubleDollarNode: ts.Statement = ts.factory.createExpressionStatement(
2563 const attrStatement: ts.Statement = ts.factory.createExpressionStatement(
2577 function isGestureType(node: ts.Identifier): boolean {
2581 function filterRegularAttrNode(argumentsNode: ts.NodeArray<ts.Expression>) {
2582 return argumentsNode.every((argument: ts.Expression) => {
2588 function isRegularAttrNode(node: ts.Expression): boolean {
2589 if (ts.isObjectLiteralExpression(node)) {
2590 return node.properties.every((propNode: ts.PropertyAssignment) => {
2597 if (ts.isArrayLiteralExpression(node)) {
2598 return node.elements.every((child: ts.Expression) => {
2607 if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.expression) &&
2608 ts.isIdentifier(node.name)) {
2613 const type: ts.Type = globalProgram.checker.getTypeAtLocation(node);
2623 if (ts.isPropertyAccessExpression(node)) {
2629 function isLiteralNode(node: ts.Expression): boolean {
2630 return ts.isStringLiteral(node) || ts.isNumericLiteral(node) || ts.isArrowFunction(node) ||
2631 [ts.SyntaxKind.TrueKeyword, ts.SyntaxKind.FalseKeyword].includes(node.kind);
2634 function traversePropNode(node: ts.PropertyAccessExpression, result: AttrResult): void {
2635 if (node.expression.kind === ts.SyntaxKind.ThisKeyword && ts.isIdentifier(node.name) &&
2640 if (ts.isPropertyAccessExpression(node.expression)) {
2645 function isDoubleDollarToChange(isStylesAttr: boolean, identifierNode: ts.Identifier,
2655 function isHaveDoubleDollar(param: ts.PropertyAssignment, name: string): boolean {
2656 return ts.isPropertyAssignment(param) && param.name && ts.isIdentifier(param.name) &&
2661 function loopEtscomponent(node: any, isStylesAttr: boolean): ts.Node {
2662 node.arguments.forEach((item: ts.Node, index: number) => {
2663 if (ts.isEtsComponentExpression(item)) {
2664 node.arguments[index] = ts.factory.createCallExpression(
2666 } else if ((ts.isCallExpression(item) || ts.isNewExpression(item)) &&
2668 node.arguments[index] = ts.visitEachChild(item,
2675 function changeEtsComponentKind(node: ts.Node): ts.Node {
2676 if (ts.isEtsComponentExpression(node)) {
2680 return ts.visitEachChild(node, changeEtsComponentKind, contextGlobal);
2683 function classifyArgumentsNum(args: any, argumentsArr: ts.Expression[], propName: string,
2684 identifierNode: ts.Identifier): void {
2686 const varExp: ts.Expression = updateArgumentFor$$(args[0]);
2691 const varExp: ts.Expression = updateArgumentFor$$(args[0]);
2696 function generateObjectFor$$(varExp: ts.Expression): ts.ObjectLiteralExpression {
2697 return ts.factory.createObjectLiteralExpression(
2699 ts.factory.createPropertyAssignment(
2700 ts.factory.createIdentifier($$_VALUE),
2703 ts.factory.createPropertyAssignment(
2704 ts.factory.createIdentifier($$_CHANGE_EVENT),
2712 function createViewStackProcessor(item: any, endViewStack: boolean): ts.ExpressionStatement {
2713 const argument: ts.StringLiteral[] = [];
2715 argument.push(ts.factory.createStringLiteral(item.name.getText()));
2717 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
2718 ts.factory.createPropertyAccessExpression(
2719 ts.factory.createIdentifier(VIEW_STACK_PROCESSOR),
2720 ts.factory.createIdentifier(VISUAL_STATE)
2727 function traverseStateStylesAttr(temp: any, statements: ts.Statement[],
2728 identifierNode: ts.Identifier, log: LogInfo[], updateStatements: ts.Statement[],
2729 newImmutableStatements: ts.Statement[] = null, isRecycleComponent: boolean = false): void {
2730 temp.arguments[0].properties.reverse().forEach((item: ts.PropertyAssignment) => {
2731 if (ts.isPropertyAccessExpression(item.initializer) &&
2735 bindComponentAttr(INNER_STYLE_FUNCTION.get(name).statements[0] as ts.ExpressionStatement,
2738 bindComponentAttr(INNER_STYLE_FUNCTION.get(name).statements[0] as ts.ExpressionStatement,
2741 } else if (ts.isIdentifier(item.initializer) &&
2744 bindComponentAttr(GLOBAL_STYLE_FUNCTION.get(name).statements[0] as ts.ExpressionStatement,
2747 bindComponentAttr(GLOBAL_STYLE_FUNCTION.get(name).statements[0] as ts.ExpressionStatement,
2750 } else if (ts.isObjectLiteralExpression(item.initializer) &&
2752 ts.isPropertyAssignment(item.initializer.properties[0])) {
2753 bindComponentAttr(ts.factory.createExpressionStatement(
2757 bindComponentAttr(ts.factory.createExpressionStatement(
2762 …if (!(ts.isObjectLiteralExpression(item.initializer) && item.initializer.properties.length === 0))…
2767 const viewNode: ts.Statement = createViewStackProcessor(item, false);
2780 function isExtendFunctionNode(identifierNode: ts.Identifier, propName: string,
2803 function parseGesture(node: ts.CallExpression, propName: string, statements: ts.Statement[],
2804 log: LogInfo[], updateStatements: ts.Statement[]): void {
2805 const popNode: ts.Statement = ts.factory.createExpressionStatement(
2806 createFunction(ts.factory.createIdentifier(COMPONENT_GESTURE),
2807 ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null));
2811 const argumentArr: ts.NodeArray<ts.PropertyAccessExpression> = ts.factory.createNodeArray(
2812 [ts.factory.createPropertyAccessExpression(
2813 ts.factory.createIdentifier(GESTURE_ENUM_KEY),
2814 ts.factory.createIdentifier(gestureMap.get(propName)))
2818 ts.isPropertyAccessExpression(node.arguments[1])) {
2822 const createNode: ts.Statement = ts.factory.createExpressionStatement(
2823 createFunction(ts.factory.createIdentifier(COMPONENT_GESTURE),
2824 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), argumentArr));
2829 function processGestureType(node: ts.CallExpression, statements: ts.Statement[], log: LogInfo[],
2830 updateStatements: ts.Statement[], reverse: boolean = false): void {
2831 const newStatements: ts.Statement[] = [];
2832 const newNode: ts.ExpressionStatement = ts.factory.createExpressionStatement(node);
2834 while (temp && !ts.isIdentifier(temp) && temp.expression) {
2837 if (temp && temp.parent && ts.isCallExpression(temp.parent) && ts.isIdentifier(temp) &&
2839 newStatements.push(ts.factory.createExpressionStatement(
2840 createFunction(temp, ts.factory.createIdentifier(COMPONENT_POP_FUNCTION), null)));
2842 const gestureStatements: ts.Statement[] = [];
2846 let argumentArr: ts.NodeArray<ts.Expression> = null;
2849 argumentArr = ts.factory.createNodeArray([temp.parent.arguments[0]]);
2851 newStatements.push(ts.factory.createExpressionStatement(
2852 createFunction(temp, ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), argumentArr)));
2855 newStatements.push(ts.factory.createExpressionStatement(
2856 …createFunction(temp, ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), temp.parent.arguments…
2865 function parseGestureInterface(node: ts.CallExpression, statements: ts.Statement[], log: LogInfo[],
2866 updateStatements: ts.Statement[], reverse: boolean = false): void {
2868 node.arguments.forEach((item: ts.Node) => {
2869 if (ts.isCallExpression(item)) {
2876 export function getName(node: ts.ExpressionStatement | ts.Expression): string {
2881 if (ts.isIdentifier(temp) && temp.parent && (ts.isCallExpression(temp.parent) ||
2882 ts.isEtsComponentExpression(temp.parent))) {
2885 } else if (ts.isPropertyAccessExpression(temp) && temp.name && ts.isIdentifier(temp.name) &&
2895 function isCustomAttributes(temp: ts.PropertyAccessExpression): boolean {
2898 …} else if (temp.expression && ts.isIdentifier(temp.expression) && temp.expression.getText() === $$…
2906 export function isAttributeNode(node: ts.ExpressionStatement): boolean {
2910 if (ts.isCallExpression(temp) && temp.expression && ts.isIdentifier(temp.expression)) {
2929 function isEtsComponent(node: ts.ExpressionStatement): boolean {
2933 if (ts.isEtsComponentExpression(temp)) {
2941 function isSomeName(forEachParameters: ts.NodeArray<ts.ParameterDeclaration>, name: string): boolea…
2944 return ts.isIdentifier(item.name) ? item.name.escapedText.toString() === name : false;
2948 function isParamFunction(node: ts.ExpressionStatement): boolean {
2949 return node.expression && ts.isCallExpression(node.expression) &&
2950 node.expression.expression && ts.isIdentifier(node.expression.expression);
2953 function getComponentType(node: ts.ExpressionStatement, log: LogInfo[], name: string,
2954 …parent: string, forEachParameters: ts.NodeArray<ts.ParameterDeclaration> = undefined): ComponentTy…
2978 ts.isCallExpression(node.expression) && ts.isIdentifier(node.expression.expression)) {
2990 function isPartMethod(node: ts.ExpressionStatement): boolean {
2991 …if (ts.isCallExpression(node.expression) && ts.isPropertyAccessExpression(node.expression.expressi…
2993 node.expression.expression.expression.kind === ts.SyntaxKind.ThisKeyword) {
3000 function isWrappedBuilderExpression(node: ts.ExpressionStatement): boolean {
3002 isWrappedBuilderCallExpression(node.expression as ts.CallExpression)) {
3008 function judgeBuilderType(node: ts.ExpressionStatement): boolean {
3009 let checker: ts.TypeChecker;
3016 const type: ts.Type = checker.getTypeAtLocation(node.expression.expression);
3032 function getEtsComponentExpression(node:ts.ExpressionStatement): ts.EtsComponentExpression {
3035 if (ts.isEtsComponentExpression(current)) {
3043 function checkEtsAndIdInIf(node:ts.ExpressionStatement, parent: string): [ts.EtsComponentExpression…
3045 let idName: ts.Expression;
3047 if (ts.isEtsComponentExpression(current)) {
3050 …if (!idName && parent === COMPONENT_IF && ts.isPropertyAccessExpression(current) && current.name &&
3051 ts.isIdentifier(current.name) && current.name.escapedText.toString() === ATTRIBUTE_ID &&
3060 function checkIdInIf(node:ts.ExpressionStatement, parent: string): ts.Expression {
3062 let idName: ts.Expression;
3064 if (parent === COMPONENT_IF && ts.isPropertyAccessExpression(current) && current.name &&
3065 ts.isIdentifier(current.name) && current.name.escapedText.toString() === ATTRIBUTE_ID &&
3075 function checkEtsComponent(node: ts.ExpressionStatement, log: LogInfo[]): void {
3076 const etsComponentExpression: ts.EtsComponentExpression = getEtsComponentExpression(node);
3087 function checkButtonParamHasLabel(node: ts.EtsComponentExpression, log: LogInfo[]): void {
3090 let argument: ts.Expression = node.arguments[i];
3091 …if (ts.isStringLiteral(argument) || (ts.isCallExpression(argument) && ts.isIdentifier(argument.exp…
3104 function isLazyForEachChild(node: ts.ExpressionStatement): boolean {
3106 while (temp && !ts.isEtsComponentExpression(temp) && !ts.isCallExpression(temp)) {
3109 …if (temp && temp.expression && (temp.expression as ts.Identifier).escapedText.toString() === COMPO…
3115 function processDollarEtsComponent(argumentsArr: ts.NodeArray<ts.Expression>, name: string): ts.Exp…
3116 const arr: ts.Expression[] = [];
3117 argumentsArr.forEach((item: ts.Expression, index: number) => {
3118 if (ts.isObjectLiteralExpression(item) && item.properties && item.properties.length) {
3119 const properties: ts.PropertyAssignment[] = [];
3120 item.properties.forEach((param: ts.PropertyAssignment, paramIndex: number) => {
3122 const varExp: ts.Expression = updateArgumentFor$$(param.initializer);
3123 …properties.push(ts.factory.updatePropertyAssignment(param, param.name, generateObjectFor$$(varExp)…
3128 arr.push(ts.factory.updateObjectLiteralExpression(item, properties));
3136 export function createFunction(node: ts.Identifier, attrNode: ts.Identifier,
3137 …argumentsArr: ts.NodeArray<ts.Expression>, isAttributeModifier: boolean = false): ts.CallExpressio…
3152 return ts.factory.createCallExpression(
3153 isAttributeModifier ? ts.factory.createCallExpression(
3154 ts.factory.createPropertyAccessExpression(
3155 ts.factory.createPropertyAccessExpression(
3159 ts.factory.createIdentifier(BUILDER_ATTR_BIND)
3162 [ts.factory.createThis()]
3163 ) : ts.factory.createPropertyAccessExpression(
3172 function checkCreateArgumentBuilder(node: ts.Identifier, attrNode: ts.Identifier): boolean {
3180 function transformBuilder(argumentsArr: ts.NodeArray<ts.Expression>): ts.NodeArray<ts.Expression> {
3181 const newArguments: ts.Expression[] = [];
3182 argumentsArr.forEach((argument: ts.Expression) => {
3189 function parseCreateParameterBuilder(argument: ts.Expression):ts.Expression {
3190 if (ts.isObjectLiteralExpression(argument)) {
3197 function checkNonspecificParents(node: ts.ExpressionStatement, name: string, savedParent: string, l…