How to draw polygon cross the prime meridian at -180 degree?

image
I have some bug when i draw polygon cross the prime meridian at -180 degree . How can i fix this?
let test=[178.381233,50.582299,-179.58233099999998,50.868945000000004,-179.072331,50.358945,178.891233,50.072298999999994]
const testredPolygon1 = viewer.entities.add({
name: “Red polygon on surface”,
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray(test),
material: Cesium.Color.RED.withAlpha(0.5),
},
});