cross file private pattern on javascript