Illegal to pass raw pointer object from JS into smart pointer parameter