[js] disallow types that "contain" Class<T> as Map key (see #2479)