Thanks ! If you are looking at that, I wonder if it is also a good moment to look at the Quantum Uncertainty bug in which using Edit > Copy As JavaScript immediately mutates the geometry of certain shapes.
It turns out that the same bug changes the position and size of some shapes if we seek any knowledge of their .shapeVertices or .shapeControlPoints through the omniJS interface. (Seen in both macOS and iOS in current builds).
Perhaps this sheds some light on what is happening when Copy As JS mutates shape geometry ?
First, create one of the polygonal shapes like a Pentagon, and start with a known size:
So far so good.
Code and response from Console
g = document.windows[0].selection.graphics[0]
[object Shape]
g.shape
AdjustableStar
g.geometry
[object Rect: (226.429650353308, 219.837279773695, 47.1398939107245, 42.5969600262851)]
g.geometry = new Rect(200, 200, 100, 100)
[object Rect: (200.0, 200.0, 100.0, 100.0)]
g.geometry
[object Rect: (200.0, 200.0, 100.0, 100.0)]
g.shapeControlPoints
[object Point: (254.755282609718, 214.635255912781)],[object Point: (254.755282609718, 214.635255912781)],[object Point: (260.103129010611, 231.094235763816)],[object Point: (260.103129010611, 231.094235763816)],[object Point: (260.772500380058, 233.154349135948)],[object Point: (262.692280336141, 234.549150918455)],[object Point: (264.858411711722, 234.549150878861)],[object Point: (264.858411711722, 234.549150878861)],[object Point: (282.164407171801, 234.549150562531)],[object Point: (282.164407171801, 234.549150562531)],[object Point: (284.925830920955, 234.549150512056)],[object Point: (287.164407212719, 236.787726721984)],[object Point: (287.164407263194, 239.549150471138)],[object Point: (287.16440729245, 241.149675596113)],[object Point: (286.398185493943, 242.65347054741)],[object Point: (285.103333450718, 243.594235588126)],[object Point: (285.103333450718, 243.594235588126)],[object Point: (271.102488833004, 253.766444239885)],[object Point: (271.102488833004, 253.766444239885)],[object Point: (269.350051714838, 255.039664284947)],[object Point: (268.616761022535, 257.296500976612)],[object Point: (269.286132467295, 259.356614324274)],[object Point: (269.286132467295, 259.356614324274)],[object Point: (274.633979469882, 275.815593979806)],[object Point: (274.633979469882, 275.815593979806)],[object Point: (275.487306385046, 278.441864015093)],[object Point: (274.05005201073, 281.262634676671)],[object Point: (271.423781975443, 282.115961591834)],[object Point: (269.901592134882, 282.610551083199)],[object Point: (268.23462259008, 282.346529044808)],[object Point: (266.939770581247, 281.405763956756)],[object Point: (266.939770581247, 281.405763956756)],[object Point: (252.938926335401, 271.233554793165)],[object Point: (252.938926335401, 271.233554793165)],[object Point: (251.18648926378, 269.960334684038)],[object Point: (248.81351073622, 269.960334684038)],[object Point: (247.061073664599, 271.233554793165)],[object Point: (247.061073664599, 271.233554793165)],[object Point: (233.060229418753, 281.405763956756)],[object Point: (233.060229418753, 281.405763956756)],[object Point: (230.826190706685, 283.028888152674)],[object Point: (227.699342361115, 282.533644086069)],[object Point: (226.076218165197, 280.299605374001)],[object Point: (225.135453077145, 279.004753365169)],[object Point: (224.871431038753, 277.337783820367)],[object Point: (225.366020530118, 275.815593979806)],[object Point: (225.366020530118, 275.815593979806)],[object Point: (230.713867532705, 259.356614324274)],[object Point: (230.713867532705, 259.356614324274)],[object Point: (231.383238977465, 257.296500976612)],[object Point: (230.649948285162, 255.039664284947)],[object Point: (228.897511166996, 253.766444239885)],[object Point: (228.897511166996, 253.766444239885)],[object Point: (214.896666549282, 243.594235588126)],[object Point: (214.896666549282, 243.594235588126)],[object Point: (212.662627777877, 241.971111473878)],[object Point: (212.167383596964, 238.844263146412)],[object Point: (213.790507711211, 236.610224375008)],[object Point: (214.731272751927, 235.315372331783)],[object Point: (216.235067703224, 234.549150533276)],[object Point: (217.835592828199, 234.549150562531)],[object Point: (217.835592828199, 234.549150562531)],[object Point: (235.141588288278, 234.549150878861)],[object Point: (235.141588288278, 234.549150878861)],[object Point: (237.307719663859, 234.549150918455)],[object Point: (239.227499619942, 233.154349135948)],[object Point: (239.896870989389, 231.094235763816)],[object Point: (239.896870989389, 231.094235763816)],[object Point: (245.244717390282, 214.635255912781)],[object Point: (245.244717390282, 214.635255912781)],[object Point: (246.098044209437, 212.008985846299)],[object Point: (248.918814818472, 210.571731368864)],[object Point: (251.545084884955, 211.425058188018)],[object Point: (253.067274743596, 211.919647623736)],[object Point: (254.260693174, 213.11306605414)],[object Point: (254.755282609718, 214.635255912781)],[object Point: (254.755282609718, 214.635255912781)],[object Point: (254.755282609718, 214.635255912781)]
g.geometry
[object Rect: (212.83523804277, 211.178990801344, 74.3291692204249, 71.1820429311419)]