js extension: more prototype functions