Now the mask and polygon is produced as individual rings at the js level.
Fixed missing semicolon.
Trying with unioning polygons.