protection for js gated objects of being passed between contexts