Weakly convergent sequences of functions and orthogonal polynomials