detect functions coming from other JavaScript contexts