• Home
  • Raw
  • Download

Lines Matching refs:ts

16 import ts from 'typescript';
141 export let contextGlobal: ts.TransformationContext;
145 export function processUISyntax(program: ts.Program, ut = false,
147 let entryNodeKey: ts.Expression;
148 return (context: ts.TransformationContext) => {
152 return (node: ts.SourceFile) => {
166 node = ts.visitEachChild(node, processResourceNode, context);
169 … const processedNode: ts.SourceFile = ts.getTypeExportImportAndConstEnumTransformer(context)(node);
176 node = ts.visitEachChild(node, processAllNodes, context);
182 const statements: ts.Statement[] = Array.from(node.statements);
189 node = ts.factory.updateSourceFile(node, statements);
193 … const processedNode: ts.SourceFile = ts.getTypeExportImportAndConstEnumTransformer(context)(node);
203 function entryKeyNode(node: ts.Node): ts.Expression {
204 const decorators: readonly ts.Decorator[] = ts.getAllDecorators(node); constant
207 …if (item.expression && ts.isCallExpression(item.expression) && ts.isIdentifier(item.expression.exp…
209 item.expression.arguments.length && ts.isIdentifier(item.expression.arguments[0])) {
217 function isESObjectNode(node: ts.Node): boolean {
218 if (node.kind === ts.SyntaxKind.TypeReference) {
220 …if (n.typeName?.kind === ts.SyntaxKind.Identifier && (n.typeName as ts.Identifier).escapedText ===…
227 function processAllNodes(node: ts.Node): ts.Node {
229 ts.isImportDeclaration(node)) {
234 (ts.isImportDeclaration(node) || ts.isImportEqualsDeclaration(node) ||
235ts.isExportDeclaration(node) && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)))…
238 if (ts.isStructDeclaration(node)) {
249 } else if (ts.isFunctionDeclaration(node)) {
258 ts.isBlock(node.body)) {
263 const parameters: ts.NodeArray<ts.ParameterDeclaration> =
264 ts.factory.createNodeArray(Array.from(node.parameters));
272 node = ts.factory.updateFunctionDeclaration(node, ts.getModifiers(node),
312 node = processResourceData(node as ts.CallExpression);
314 node = processWorker(node as ts.NewExpression);
316 node = processAnimateToOrImmediately(node as ts.CallExpression);
320 node = ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword);
321 } else if (ts.isDecorator(node)) {
325 if (node.arguments && node.arguments[0] && (!ts.isIdentifier(node.arguments[0]) ||
326 ts.isIdentifier(node.arguments[0]) &&
334 } else if (ts.isClassDeclaration(node)) {
339 return ts.visitEachChild(node, processAllNodes, context);
342 function processResourceNode(node: ts.Node): ts.Node {
343 if (ts.isImportDeclaration(node)) {
346 node = processResourceData(node as ts.CallExpression);
347 } else if (ts.isTypeReferenceNode(node)) {
350 return ts.visitEachChild(node, processResourceNode, context);
353 function isWrapBuilderFunction(node: ts.Node): boolean {
354 if (ts.isCallExpression(node) && node.expression && ts.isIdentifier(node.expression) &&
363 export function initializeMYIDS(): ts.ParameterDeclaration {
364 return ts.factory.createParameterDeclaration(
367 ts.factory.createIdentifier(MY_IDS),
370 ts.factory.createArrayLiteralExpression(
377 function generateId(statements: ts.Statement[], node: ts.SourceFile): void {
379 ts.factory.createVariableStatement(
381 ts.factory.createVariableDeclarationList(
382 [ts.factory.createVariableDeclaration(
383 ts.factory.createIdentifier(_GENERATE_ID),
385 ts.factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword),
386 ts.factory.createNumericLiteral('0')
388 ts.NodeFlags.Let
391 ts.factory.createFunctionDeclaration(
394 ts.factory.createIdentifier(GENERATE_ID),
397 ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
398 ts.factory.createBlock(
399 [ts.factory.createReturnStatement(ts.factory.createBinaryExpression(
400 ts.factory.createStringLiteral(path.basename(node.fileName, EXTNAME_ETS) + '_'),
401 ts.factory.createToken(ts.SyntaxKind.PlusToken), ts.factory.createPrefixUnaryExpression(
402 ts.SyntaxKind.PlusPlusToken,
403 ts.factory.createIdentifier(_GENERATE_ID)
419 function isCustomDialogController(node: ts.Expression) {
420 const tempParent: ts.Node = node.parent;
426 if (ts.isNewExpression(node) && node.expression && ts.isIdentifier(node.expression) &&
436 function createCustomDialogController(parent: ts.Expression, node: ts.NewExpression,
437 log: LogInfo[]): ts.NewExpression {
439 ts.isObjectLiteralExpression(node.arguments[0]) && node.arguments[0].properties) {
440 … const newproperties: ts.ObjectLiteralElementLike[] = node.arguments[0].properties.map((item) => {
444 item as ts.PropertyAssignment, componentName);
448 return ts.factory.createNewExpression(node.expression, node.typeArguments,
449 [ts.factory.createObjectLiteralExpression(newproperties, true), ts.factory.createThis()]);
455 function isCustomDialogControllerPropertyAssignment(node: ts.ObjectLiteralElementLike,
457 if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) &&
471 function validateCustomDialogControllerBuilderInit(node: ts.ObjectLiteralElementLike,
480 function processCustomDialogControllerPropertyAssignment(parent: ts.Expression,
481 node: ts.PropertyAssignment, componentName: string): ts.PropertyAssignment {
482 if (ts.isCallExpression(node.initializer)) {
483 return ts.factory.updatePropertyAssignment(node, node.name,
488 function processCustomDialogControllerBuilder(parent: ts.Expression,
489 node: ts.CallExpression, componentName: string): ts.ArrowFunction {
490 …const newExp: ts.Expression = createCustomComponentNewExpression(node, componentName, false, false…
491 const jsDialog: ts.Identifier = ts.factory.createIdentifier(JS_DIALOG);
495 function createCustomComponentBuilderArrowFunction(node: ts.CallExpression, parent: ts.Expression,
496 jsDialog: ts.Identifier, newExp: ts.Expression): ts.ArrowFunction {
497 let mountNodde: ts.PropertyAccessExpression;
498 if (ts.isBinaryExpression(parent)) {
500 } else if (ts.isVariableDeclaration(parent) || ts.isPropertyDeclaration(parent)) {
501 mountNodde = ts.factory.createPropertyAccessExpression(ts.factory.createThis(),
502 parent.name as ts.Identifier);
504 return ts.factory.createArrowFunction(
509 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
510 ts.factory.createBlock(
512 ts.factory.createVariableStatement(
514 ts.factory.createVariableDeclarationList(
515 [ts.factory.createVariableDeclaration(jsDialog, undefined, undefined, newExp)],
516 ts.NodeFlags.Let
519 ts.factory.createExpressionStatement(
520 ts.factory.createCallExpression(
521 ts.factory.createPropertyAccessExpression(
523 ts.factory.createIdentifier(SET_CONTROLLER_METHOD)
529 ts.factory.createExpressionStatement(createViewCreate(jsDialog)),
538 export function isResource(node: ts.Node): boolean {
539 return ts.isCallExpression(node) && ts.isIdentifier(node.expression) &&
544 export function isAnimateToOrImmediately(node: ts.Node): boolean {
545 return ts.isCallExpression(node) && ts.isIdentifier(node.expression) &&
549 export function processResourceData(node: ts.CallExpression,
550 … {isAcceleratePreview: boolean, log: LogInfo[]} = {isAcceleratePreview: false, log: []}): ts.Node {
551 if (ts.isStringLiteral(node.arguments[0])) {
578 function checkTypeReference(node: ts.TypeReferenceNode): void {
582 const checker: ts.TypeChecker = globalProgram.checker;
586 const type: ts.Type = checker.getTypeAtLocation(node);
587 let sourceFile: ts.SourceFile | undefined = undefined;
589 sourceFile = ts.getSourceFileOfNode(type.aliasSymbol.declarations[0]);
591 sourceFile = ts.getSourceFileOfNode(type.symbol.declarations[0]);
611 function getResourceDataNode(node: ts.CallExpression,
612 previewLog: {isAcceleratePreview: boolean, log: LogInfo[]}): ts.Node {
613 const resourceData: string[] = (node.arguments[0] as ts.StringLiteral).text.trim().split('.');
631 function isResourcefile(node: ts.CallExpression, previewLog: {isAcceleratePreview: boolean, log: Lo…
642 function addBundleAndModuleParam(propertyArray: Array<ts.PropertyAssignment>): void {
649 propertyArray.push(ts.factory.createPropertyAssignment(
650 ts.factory.createStringLiteral(RESOURCE_NAME_BUNDLE),
651 ts.factory.createStringLiteral(projectConfig.bundleName)
656 propertyArray.push(ts.factory.createPropertyAssignment(
657 ts.factory.createStringLiteral(RESOURCE_NAME_MODULE),
658 ts.factory.createStringLiteral(projectConfig.moduleName)
663 function createResourceParamWithVariable(node: ts.CallExpression): ts.ObjectLiteralExpression {
664 const propertyArray: Array<ts.PropertyAssignment> = [
665 ts.factory.createPropertyAssignment(
666 ts.factory.createStringLiteral(RESOURCE_NAME_ID),
669 ts.factory.createPropertyAssignment(
670 ts.factory.createIdentifier(RESOURCE_NAME_PARAMS),
671 ts.factory.createArrayLiteralExpression(Array.from(node.arguments).slice(1), false)
677 const resourceParams: ts.ObjectLiteralExpression = ts.factory.createObjectLiteralExpression(
682 function createResourceParam(resourceValue: number, resourceType: number, argsArr: ts.Expression[]):
683 ts.ObjectLiteralExpression {
688 const propertyArray: Array<ts.PropertyAssignment> = [
689 ts.factory.createPropertyAssignment(
690 ts.factory.createStringLiteral(RESOURCE_NAME_ID),
691 ts.factory.createNumericLiteral(resourceValue)
693 ts.factory.createPropertyAssignment(
694 ts.factory.createStringLiteral(RESOURCE_NAME_TYPE),
695 ts.factory.createNumericLiteral(resourceType)
697 ts.factory.createPropertyAssignment(
698 ts.factory.createIdentifier(RESOURCE_NAME_PARAMS),
699 ts.factory.createArrayLiteralExpression(argsArr, false)
705 const resourceParams: ts.ObjectLiteralExpression = ts.factory.createObjectLiteralExpression(
755 function isWorker(node: ts.Node): boolean {
756 return ts.isNewExpression(node) && ts.isPropertyAccessExpression(node.expression) &&
757 ts.isIdentifier(node.expression.name) &&
761 function processWorker(node: ts.NewExpression): ts.Node {
762 if (node.arguments.length && ts.isStringLiteral(node.arguments[0])) {
763 const args: ts.Expression[] = Array.from(node.arguments);
766 const stringNode: ts.StringLiteral = ts.factory.createStringLiteral(
769 return ts.factory.updateNewExpression(node, node.expression, node.typeArguments, args);
774 export function processAnimateToOrImmediately(node: ts.CallExpression): ts.CallExpression {
775 return ts.factory.updateCallExpression(node, ts.factory.createPropertyAccessExpression(
776 ts.factory.createIdentifier(GLOBAL_CONTEXT),
777 ts.factory.createIdentifier(node.expression.escapedText.toString())),
781 function processExtend(node: ts.FunctionDeclaration, log: LogInfo[],
782 decoratorName: string): ts.FunctionDeclaration {
785 const statementArray: ts.Statement[] = [];
786 let bodynode: ts.Block;
788 const attrSet: ts.CallExpression = node.body.statements[0].expression;
790 …const changeCompName: ts.ExpressionStatement = ts.factory.createExpressionStatement(processExtendB…
791 bindComponentAttr(changeCompName as ts.ExpressionStatement,
792 ts.factory.createIdentifier(componentName), statementArray, log);
794 bodynode = ts.visitEachChild(node.body, traverseExtendExpression, contextGlobal);
803 return ts.factory.updateFunctionDeclaration(node, ts.getModifiers(node), node.asteriskToken,
804 ts.factory.createIdentifier(extendFunctionName), node.typeParameters,
805 … node.parameters, ts.factory.createToken(ts.SyntaxKind.VoidKeyword), isOriginalExtend(node.body) ?
806 ts.factory.updateBlock(node.body, statementArray) : bodynode);
810 ts.factory.createIdentifier(componentName), statementArray, log);
811 return ts.factory.updateFunctionDeclaration(node, ts.getModifiers(node), node.asteriskToken,
813 …[...node.parameters, ...createAnimatableParameterNode()], ts.factory.createToken(ts.SyntaxKind.Voi…
814 ts.factory.updateBlock(node.body, createAnimatableBody(componentName, node.name,
818 function traverseExtendExpression(node: ts.Node): ts.Node {
819 if (ts.isExpressionStatement(node) && isDollarNode(node, componentName)) {
820 const changeCompName: ts.ExpressionStatement =
821 ts.factory.createExpressionStatement(processExtendBody(node.expression, componentName));
822 const statementArray: ts.Statement[] = [];
823 … bindComponentAttr(changeCompName, ts.factory.createIdentifier(componentName), statementArray, []);
824 return ts.factory.createBlock(statementArray, true);
826 return ts.visitEachChild(node, traverseExtendExpression, contextGlobal);
830 function createAnimatableParameterNode(): ts.ParameterDeclaration[] {
832 ts.factory.createParameterDeclaration(
833 undefined, undefined, ts.factory.createIdentifier(ELMTID)),
834 ts.factory.createParameterDeclaration(
835 undefined, undefined, ts.factory.createIdentifier(ISINITIALRENDER)),
836 ts.factory.createParameterDeclaration(
837 undefined, undefined, ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT))
841 function createAnimatableBody(componentName: string, funcName: ts.Identifier,
842 parameters: ts.NodeArray<ts.ParameterDeclaration>, attrArray: ts.Statement[]): ts.Statement[] {
843 const paramNode: ts.Identifier[] = [];
844 parameters.forEach((item: ts.ParameterDeclaration) => {
845 if (item.name && ts.isIdentifier(item.name)) {
850 ts.factory.createIfStatement(
851 ts.factory.createIdentifier(ISINITIALRENDER),
852 ts.factory.createBlock([
856 ts.factory.createBlock([
857 ts.factory.createExpressionStatement(ts.factory.createCallExpression(
858 ts.factory.createPropertyAccessExpression(
859 ts.factory.createIdentifier(componentName),
860 ts.factory.createIdentifier(UPDATE_ANIMATABLE_PROPERTY)
862 [ts.factory.createStringLiteral(funcName.escapedText.toString()), ...paramNode]
869 function createAnimatableProperty(componentName: string, funcName: ts.Identifier,
870 parameters: ts.NodeArray<ts.ParameterDeclaration>,
871 paramNode: ts.Identifier[], attrArray: ts.Statement[]) {
872 const componentIdentifier: ts.Identifier = ts.factory.createIdentifier(componentName);
873 return ts.factory.createExpressionStatement(
874 ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(
876 ts.factory.createIdentifier(CREATE_ANIMATABLE_PROPERTY)),
878 ts.factory.createStringLiteral(funcName.escapedText.toString()),
880 ts.factory.createArrowFunction(undefined, undefined, parameters, undefined,
881 ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
882 ts.factory.createBlock([
894 function createAnimatableFrameNode(componentName: string): ts.ExpressionStatement {
895 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
896 ts.factory.createPropertyAccessExpression(
897 ts.factory.createIdentifier(VIEW_STACK_PROCESSOR),
898 ts.factory.createIdentifier(GET_AND_PUSH_FRAME_NODE)
901 ts.factory.createStringLiteral(componentName),
902 ts.factory.createIdentifier(ELMTID)
907 function createAnimatableUpdateFunc(): ts.ExpressionStatement {
908 return ts.factory.createExpressionStatement(ts.factory.createCallExpression(
909 ts.factory.createPropertyAccessExpression(
910 ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
911 ts.factory.createIdentifier(FINISH_UPDATE_FUNC)
912 ), undefined, [ts.factory.createIdentifier(ELMTID)]
916 function processConcurrent(node: ts.FunctionDeclaration): ts.FunctionDeclaration {
918 const statementArray: ts.Statement[] =
919 [ts.factory.createExpressionStatement(ts.factory.createStringLiteral('use concurrent')),
921 …return ts.factory.updateFunctionDeclaration(node, ts.getModifiers(node), node.asteriskToken, node.…
922 …node.typeParameters, node.parameters, node.type, ts.factory.updateBlock(node.body, statementArray)…
927 function processClassSendable(node: ts.ClassDeclaration): ts.ClassDeclaration {
929 let updatedMembers: ts.NodeArray<ts.ClassElement> = node.members;
930 let updatedModifiers: ts.NodeArray<ts.ModifierLike> = node.modifiers;
932 updatedModifiers = ts.factory.createNodeArray(
940 if (ts.isConstructorDeclaration(member)) {
942 const constructor: ts.ConstructorDeclaration = member as ts.ConstructorDeclaration;
944 const statementArray: ts.Statement[] = [
945 ts.factory.createExpressionStatement(ts.factory.createStringLiteral('use sendable')),
949 …const updatedConstructor: ts.ConstructorDeclaration = ts.factory.updateConstructorDeclaration(cons…
950 constructor.parameters, ts.factory.updateBlock(constructor.body, statementArray));
952 updatedMembers = ts.factory.createNodeArray(
960 const constructor: ts.ConstructorDeclaration = ts.factory.createConstructorDeclaration(
963 ts.factory.createBlock(
964 [ts.factory.createExpressionStatement(ts.factory.createStringLiteral('use sendable'))],
968 updatedMembers = ts.factory.createNodeArray([constructor, ...(updatedMembers || [])]);
971 node = ts.factory.updateClassDeclaration(node, updatedModifiers, node.name, node.typeParameters,
977 export function isOriginalExtend(node: ts.Block): boolean {
978 let innerNode: ts.Node = node.statements[0];
979 if (node.statements.length === 1 && ts.isExpressionStatement(innerNode)) {
983 …if (ts.isIdentifier(innerNode) && innerNode.pos && innerNode.end && innerNode.pos === innerNode.en…
991 function isDollarNode(node: ts.ExpressionStatement, componentName: string): boolean {
992 let innerNode: ts.Node = node;
1000 if (ts.isIdentifier(innerNode) && innerNode.getText() === changedIdentifier) {
1007 function processExtendBody(node: ts.Node, componentName?: string): ts.Expression {
1009 case ts.SyntaxKind.CallExpression:
1010 return ts.factory.createCallExpression(processExtendBody(node.expression, componentName),
1012 case ts.SyntaxKind.PropertyAccessExpression:
1013 return ts.factory.createPropertyAccessExpression(
1015 case ts.SyntaxKind.Identifier:
1017 return ts.factory.createIdentifier(node.escapedText.toString().replace(INSTANCE, ''));
1019 return ts.factory.createIdentifier(componentName);
1032 export function isExtendFunction(node: ts.FunctionDeclaration, extendResult: ExtendResult,
1034 const decorators: readonly ts.Decorator[] = ts.getAllDecorators(node); constant
1037 if (ts.isCallExpression(decorators[i].expression)) {
1038 … parseExtendNode(decorators[i].expression as ts.CallExpression, extendResult, checkArguments);
1048 function parseExtendNode(node: ts.CallExpression, extendResult: ExtendResult, checkArguments: boole…
1049 if (ts.isIdentifier(node.expression)) {
1060 if (node.arguments.length && ts.isIdentifier(node.arguments[0])) {
1065 function createEntryNode(node: ts.SourceFile, context: ts.TransformationContext,
1066 entryNodeKey: ts.Expression, id: number): ts.SourceFile {
1074 const entryNode: ts.ExpressionStatement =
1076 cardRelativePath, entryNodeKey, id) as ts.ExpressionStatement;
1079 const entryNodes: ts.ExpressionStatement[] =
1081 cardRelativePath, entryNodeKey, id) as ts.ExpressionStatement[];
1090 const statementsArray: ts.Statement =
1096 function createEntryFunction(name: string, context: ts.TransformationContext, cardRelativePath: str…
1097 …entryNodeKey: ts.Expression, id: number): ts.ExpressionStatement | (ts.ExpressionStatement | ts.Bl…
1098 const newArray: ts.Expression[] = [
1103 const [localStorageName, entryOptionNode]: [string, ts.Expression] = addStorageParam(name); constant
1112 const newExpressionStatement: ts.ExpressionStatement =
1119 if (entryOptionNode && ts.isObjectLiteralExpression(entryOptionNode)) {
1137 function createLoadPageConditionalJudgMent(context: ts.TransformationContext, name: string,
1138 cardRelativePath: string, localStorageName: string, entryOptionNode: ts.Expression,
1139 argsArr: ts.Expression[] = undefined, isComponentPreview: boolean = false)
1140 : (ts.ExpressionStatement | ts.Block | ts.IfStatement)[] {
1142 let routeNameNode: ts.Expression;
1143 let storageNode: ts.Expression;
1145 let originArray: ts.ExpressionStatement[];
1147 const newArray: ts.Expression[] = [
1167 if (ts.isObjectLiteralExpression(entryOptionNode)) {
1171 if (ts.isPropertyAssignment(property) && property.name && ts.isIdentifier(property.name)) {
1187 function generateLoadDocumentEntrance(isObject: boolean, routeNameNode: ts.Expression,
1188 storageNode: ts.Expression, isComponentPreview: boolean, context: ts.TransformationContext,
1189 name: string, cardRelativePath: string, entryOptionNode: ts.Expression,
1190 argsArr: ts.Expression[]): (ts.ExpressionStatement | ts.Block | ts.IfStatement)[] {
1197 ] : [ts.factory.createBlock([
1207 ] : [ts.factory.createBlock([
1217 ] : [ts.factory.createBlock([
1226 ] : [ts.factory.createBlock([
1237 function judgeRouteNameAndStorage(context: ts.TransformationContext, name: string,
1238 …cardRelativePath: string, isObject: boolean, entryOptionNode: ts.Expression, routeNameNode: ts.Exp…
1239 storageNode: ts.Expression, argsArr: ts.Expression[] = undefined): ts.IfStatement {
1245 function judgeRouteNameAndStorageForObj(context: ts.TransformationContext, name: string,
1246 …cardRelativePath: string, isObject: boolean, entryOptionNode: ts.Expression, routeNameNode: ts.Exp…
1247 storageNode: ts.Expression, argsArr: ts.Expression[] = undefined): ts.IfStatement {
1248 return ts.factory.createIfStatement(
1250 ts.factory.createBlock(
1256 ), ts.factory.createBlock(
1265 function judgeRouteNameAndStorageForIdentifier(context: ts.TransformationContext, name: string,
1266 …cardRelativePath: string, isObject: boolean, entryOptionNode: ts.Expression, routeNameNode: ts.Exp…
1267 storageNode: ts.Expression, argsArr: ts.Expression[] = undefined): ts.IfStatement {
1268 return ts.factory.createIfStatement(
1269 judgeRouteAndStorageForIdentifier(entryOptionNode as ts.Identifier, true, true),
1270 ts.factory.createBlock(
1277 ts.factory.createIfStatement(
1278 judgeRouteAndStorageForIdentifier(entryOptionNode as ts.Identifier, true, false),
1279 ts.factory.createBlock(
1286 ts.factory.createIfStatement(
1287 judgeRouteAndStorageForIdentifier(entryOptionNode as ts.Identifier, false, true),
1288 ts.factory.createBlock(
1295 ts.factory.createBlock(
1307 function judgeRouteAndStorageForObject(hasRouteName: boolean): ts.BinaryExpression {
1308 return ts.factory.createBinaryExpression(
1309 ts.factory.createIdentifier(ROUTENAME_NODE),
1310ts.factory.createToken(hasRouteName ? ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind.EqualsE…
1311 ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED)
1315 function judgeRouteAndStorageForIdentifier(entryOptionNode: ts.Identifier, hasRouteName: boolean,
1316 hasStorage: boolean): ts.BinaryExpression {
1317 return ts.factory.createBinaryExpression(
1318 ts.factory.createBinaryExpression(
1320 ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
1321 ts.factory.createBinaryExpression(
1322 ts.factory.createPropertyAccessExpression(
1324 ts.factory.createIdentifier(ROUTE_NAME)
1326ts.factory.createToken(hasRouteName ? ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind.EqualsE…
1327 ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED)
1330 ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken),
1331 ts.factory.createBinaryExpression(
1332 ts.factory.createPropertyAccessExpression(
1334 ts.factory.createIdentifier(STORAGE)
1336ts.factory.createToken(hasStorage ? ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind.EqualsEqu…
1337 ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED)
1342 function assignRouteNameAndStorage(routeNameNode): ts.ExpressionStatement[] {
1343 const assignOperation: ts.VariableStatement[] = [];
1345 assignOperation.push(ts.factory.createVariableStatement(
1347 ts.factory.createVariableDeclarationList(
1348 [ts.factory.createVariableDeclaration(
1349 ts.factory.createIdentifier(ROUTENAME_NODE),
1354 ts.NodeFlags.Let
1361 function createLoadDocumentWithRoute(context: ts.TransformationContext, name: string,
1362 cardRelativePath: string, isObject: boolean, entryOptionNode: ts.Expression,
1363 routeNameNode: ts.Node, storageNode: ts.Node, hasRouteName: boolean, hasStorage: boolean,
1364 shouldCreateAccsessRecording: boolean, argsArr: ts.Expression[]): ts.ExpressionStatement[] {
1365 const newArray: ts.Expression[] = [
1372 newArray.push(ts.factory.createPropertyAccessExpression(
1374 ts.factory.createIdentifier(STORAGE)
1390 const newExpression: ts.Expression = context.factory.createNewExpression(
1420 function createRegisterNamedRoute(context: ts.TransformationContext, newExpressionParams: ts.NewExp…
1421 …isObject: boolean, entryOptionNode: ts.Expression, hasRouteName: boolean): ts.ExpressionStatement {
1431 context.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
1434 …hasRouteName ? isObject ? ts.factory.createIdentifier(ROUTENAME_NODE) : context.factory.createProp…
1437 ) : ts.factory.createStringLiteral(''),