[js] use int_ptr_t instead of int for pointer conversion