• Home
  • Raw
  • Download

Lines Matching refs:node

317 function createControllerSet(node: ts.PropertyDeclaration, componentName: ts.Identifier,
319 if (componentCollection.customDialogs.has(componentName.getText()) && node.type &&
320 node.type.getText() === SET_CONTROLLER_CTR_TYPE) {
335 function processPropertyNodeDecorator(parentName: ts.Identifier, node: ts.PropertyDeclaration,
340 const decorators: readonly ts.Decorator[] = ts.getAllDecorators(node);
350 if (decoratorName !== COMPONENT_WATCH_DECORATOR && isForbiddenUseStateType(node.type)) {
352 validateForbiddenUseStateType(name, decoratorName, node.type.typeName.getText(), log);
359 if (node.initializer && forbiddenSpecifyDefaultValueDecorators.has(decoratorName)) {
362 } else if (!node.initializer && mandatorySpecifyDefaultValueDecorators.has(decoratorName)) {
366 …if (node.questionToken && mandatoryToInitViaParamDecorators.has(decoratorName) && !(decoratorName …
369 if (!isSimpleType(node.type, program) &&
375 processWatch(node, decorators[i], watchMap, log);
379 processStateDecorators(node, decoratorName, updateResult, ctorNode, log, program, context,
411 function processStateDecorators(node: ts.PropertyDeclaration, decorator: string,
415 const name: ts.Identifier = node.name as ts.Identifier;
419 createVariableInitStatement(node, decorator, log, program, context, hasPreview, interfaceNode);
423 addAddProvidedVar(node, name, decorator, updateState);
430 updateResult.setVariableSet(createSetAccessor(name, CREATE_SET_METHOD, node.type));
433 updateResult.setUpdateParams(createUpdateParams(name, decorator, node));
464 function processWatch(node: ts.PropertyDeclaration, decorator: ts.Decorator,
466 if (node.name) {
467 const propertyName: string = node.name.getText();
470 const currentClassMethod: Set<string> = classMethodCollection.get(node.parent.name.getText());
478 … message: `Cannot find name ${argument.getText()} in struct '${node.parent.name.getText()}'.`,
498 function createVariableInitStatement(node: ts.PropertyDeclaration, decorator: string,
501 const name: ts.Identifier = node.name as ts.Identifier;
504 if (node.type) {
505 type = node.type;
509 updateState = updateNormalProperty(node, name, log, context);
514 …updateObservedProperty(node, name, type, program) : updateObservedPropertyPU(node, name, type, pro…
517 wrongDecoratorInPreview(node, COMPONENT_LINK_DECORATOR, hasPreview, log);
522 wrongDecoratorInPreview(node, COMPONENT_PROP_DECORATOR, hasPreview, log);
529 updateState = updateStoragePropAndLinkProperty(node, name, decorator);
537 wrongDecoratorInPreview(node, COMPONENT_CONSUME_DECORATOR, hasPreview, log);
538 updateState = updateConsumeProperty(node, name);
541 updateState = updateBuilderParamProperty(node, name, log);
552 function wrongDecoratorInPreview(node: ts.PropertyDeclaration, decorator: string,
559 pos: node.getStart()
641 function updateNormalProperty(node: ts.PropertyDeclaration, name: ts.Identifier,
644 ts.visitNode(node.initializer, visitDialogController);
645 function visitDialogController(node: ts.Node): ts.Node {
646 if (isProperty(node)) {
647 node = createReference(node as ts.PropertyAssignment, log);
649 return ts.visitEachChild(node, visitDialogController, context);
693 function updateStoragePropAndLinkProperty(node: ts.PropertyDeclaration, name: ts.Identifier,
695 const decorators: readonly ts.Decorator[] = ts.getAllDecorators(node);
696 if (isSingleKey(node)) {
702 node.initializer, constant
724 function getDecoratorKey(node: ts.PropertyDeclaration, isProvided: boolean = false): [string, boole…
728 const decorators: readonly ts.Decorator[] = ts.getAllDecorators(node);
759 function updateConsumeProperty(node: ts.PropertyDeclaration,
764 if (isSingleKey(node)) {
765 propertyAndStringKey.push(...getDecoratorKey(node));
778 function updateBuilderParamProperty(node: ts.PropertyDeclaration,
781 if (judgeBuilderParamAssignedByBuilder(node)) {
785 pos: node.getStart()
790 node.initializer || ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UNDEFINED)
794 function judgeBuilderParamAssignedByBuilder(node: ts.PropertyDeclaration): boolean {
795 return node.initializer && !(node.initializer && (ts.isIdentifier(node.initializer) &&
796 CUSTOM_BUILDER_METHOD.has(node.initializer.escapedText.toString()) ||
797 ts.isPropertyAccessExpression(node.initializer) && node.initializer.name &&
798 ts.isIdentifier(node.initializer.name) &&
799 CUSTOM_BUILDER_METHOD.has(node.initializer.name.escapedText.toString()) ||
800 isWrappedBuilder(node.initializer as ts.PropertyAccessExpression)));
803 export function createViewCreate(node: ts.NewExpression | ts.Identifier): ts.CallExpression {
806 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), ts.factory.createNodeArray([node]));
809 ts.factory.createIdentifier(COMPONENT_CREATE_FUNCTION), ts.factory.createNodeArray([node]));
812 export function createCustomComponentNewExpression(node: ts.CallExpression, name: string,
815 const newNode: ts.NewExpression = ts.factory.createNewExpression(node.expression,
816 node.typeArguments, node.arguments.length ? node.arguments : []);
820 function addCustomComponentId(node: ts.NewExpression, componentName: string,
823 const posOfNode = transformLog.sourceFile.getLineAndCharacterOfPosition(getRealNodePos(node));
830 if (node.arguments && node.arguments.length) {
831 argumentsArray = Array.from(node.arguments);