Lines Matching refs:memberExpr
1595 varbinder::Variable *ETSChecker::ResolveInstanceExtension(const ir::MemberExpression *const memberExpr)
1599 ->FindInGlobal(memberExpr->Property()->AsIdentifier()->Name(),
1611 PropertySearchFlags ETSChecker::GetInitialSearchFlags(const ir::MemberExpression *const memberExpr)
1618 switch (memberExpr->Parent()->Type()) {
1620 if (memberExpr->Parent()->AsCallExpression()->Callee() == memberExpr) {
1627 if (memberExpr->Parent()->AsETSNewClassInstanceExpression()->GetTypeRef() == memberExpr) {
1641 const auto *const assignmentExpr = memberExpr->Parent()->AsAssignmentExpression();
1643 if (assignmentExpr->Left() == memberExpr) {
1666 PropertySearchFlags ETSChecker::GetSearchFlags(const ir::MemberExpression *const memberExpr,
1669 auto searchFlag = GetInitialSearchFlags(memberExpr);
1676 } else if (memberExpr->Object()->IsThisExpression() ||
1679 (memberExpr->Object()->IsIdentifier() && memberExpr->ObjType()->GetDeclNode() != nullptr &&
1680 memberExpr->ObjType()->GetDeclNode()->IsTSInterfaceDeclaration())) {
1686 const varbinder::Variable *ETSChecker::GetTargetRef(const ir::MemberExpression *const memberExpr)
1688 if (memberExpr->Object()->IsIdentifier()) {
1689 return memberExpr->Object()->AsIdentifier()->Variable();
1691 if (memberExpr->Object()->IsMemberExpression()) {
1692 return memberExpr->Object()->AsMemberExpression()->PropVar();
1697 void ETSChecker::ValidateReadonlyProperty(const ir::MemberExpression *const memberExpr, const ETSFunctionType *propType,
1701 ETSObjectType *currentObj = memberExpr->ObjType();
1705 if (classProp != nullptr && currentObj == memberExpr->ObjType()) {
1718 if (IsInitializedProperty(memberExpr->ObjType()->GetDeclNode()->AsClassDefinition(), classProp)) {
1724 void ETSChecker::ValidateGetterSetter(const ir::MemberExpression *const memberExpr,
1731 auto const &sourcePos = memberExpr->Property()->Start();
1732 auto callExpr = memberExpr->Parent()->IsCallExpression() ? memberExpr->Parent()->AsCallExpression() : nullptr;
1739 ValidateSignatureAccessibility(memberExpr->ObjType(), callExpr, propType->FindGetter(), sourcePos);
1743 ValidateReadonlyProperty(memberExpr, propType, sourcePos);
1744 ValidateSignatureAccessibility(memberExpr->ObjType(), callExpr, propType->FindSetter(), sourcePos);
1791 void ETSChecker::ValidateVarDeclaratorOrClassProperty(const ir::MemberExpression *const memberExpr,
1795 type_annotation] = [memberExpr]() -> std::pair<const ir::Identifier *, const ir::TypeNode *> {
1796 if (memberExpr->Parent()->IsVariableDeclarator()) {
1797 const auto *const ident = memberExpr->Parent()->AsVariableDeclarator()->Id()->AsIdentifier();
1800 return {memberExpr->Parent()->AsClassProperty()->Key()->AsIdentifier(),
1801 memberExpr->Parent()->AsClassProperty()->TypeAnnotation()};
1819 LogTypeError({"Method ", memberExpr->Property()->AsIdentifier()->Name(), " does not exist on this type."},
1820 memberExpr->Property()->Start());
1826 std::vector<ResolveResult *> ETSChecker::ResolveMemberReference(const ir::MemberExpression *const memberExpr,
1832 auto propName = memberExpr->Property()->AsIdentifier()->Name();
1840 if (memberExpr->Parent()->IsCallExpression() && memberExpr->Parent()->AsCallExpression()->Callee() == memberExpr) {
1841 globalFunctionVar = ResolveInstanceExtension(memberExpr);
1846 const auto *const targetRef = GetTargetRef(memberExpr);
1847 auto searchFlag = GetSearchFlags(memberExpr, targetRef);
1852 auto searchName = target->GetReExportAliasValue(memberExpr->Property()->AsIdentifier()->Name());
1855 if (memberExpr->Parent()->IsCallExpression() && memberExpr->Parent()->AsCallExpression()->Callee() == memberExpr) {
1856 globalFunctionVar = ResolveInstanceExtension(memberExpr);
1874 ValidateResolvedProperty(&prop, target, memberExpr->Property()->AsIdentifier(), searchFlag);
1890 ResolveMemberReferenceValidate(prop, searchFlag, memberExpr);
1897 const ir::MemberExpression *const memberExpr)
1901 LogTypeError("Method used in wrong context", memberExpr->Property()->Start());
1906 ValidateGetterSetter(memberExpr, prop, searchFlag);
1912 if (memberExpr->Parent()->IsVariableDeclarator() || memberExpr->Parent()->IsClassProperty()) {
1913 ValidateVarDeclaratorOrClassProperty(memberExpr, prop);