function markPropTypesAsDeclared(node,propTypes){var componentNode=node;while(componentNode&&!components.get(componentNode)){componentNode=componentNode.parent;}var component=components.get(componentNode);var declaredPropTypes=component&&component.declaredPropTypes||{};var ignorePropsValidation=false;switch(propTypes&&propTypes.type){case'ObjectTypeAnnotation':iterateProperties(propTypes.properties,function(key,value){declaredPropTypes[key]=buildTypeAnnotationDeclarationTypes(value);});break;case'ObjectExpression':iterateProperties(propTypes.properties,function(key,value){if(!value){ignorePropsValidation=true;return;}declaredPropTypes[key]=buildReactDeclarationTypes(value);});break;case'MemberExpression':var curDeclaredPropTypes=declaredPropTypes;// Walk the list of properties, until we reach the assignment
// ie: ClassX.propTypes.a.b.c = ...
while(propTypes&&propTypes.parent&&propTypes.parent.type!=='AssignmentExpression'&&propTypes.property&&curDeclaredPropTypes){var propName=propTypes.property.name;if(propName in curDeclaredPropTypes){curDeclaredPropTypes=curDeclaredPropTypes[propName].children;propTypes=propTypes.parent;}else{// This will crash at runtime because we haven't seen this key before
// stop this and do not declare it
propTypes=null;}}if(propTypes&&propTypes.parent&&propTypes.property){curDeclaredPropTypes[propTypes.property.name]=buildReactDeclarationTypes(propTypes.parent.right);}else{ignorePropsValidation=true;}break;case'Identifier':var variablesInScope=variable.variablesInScope(context);for(var i=0,j=variablesInScope.length;i<j;i++){if(variablesInScope[i].name!==propTypes.name){continue;}var defInScope=variablesInScope[i].defs[variablesInScope[i].defs.length-1];markPropTypesAsDeclared(node,defInScope.node&&defInScope.node.init);return;}ignorePropsValidation=true;break;case null:break;default:ignorePropsValidation=true;break;}components.set(node,{declaredPropTypes:declaredPropTypes,ignorePropsValidation:ignorePropsValidation});}
Mark a prop type as declared
@param {ASTNode} node The AST node being checked.
@param {propTypes} node The AST node containing the proptypes