Closed Elettrotecnica closed 1 year ago
Are you able to make this change to remove the parentheses, then I'll merge? Thank you.
Hi! I am not sure I understand what should be changed, if you refer to this line:
({ shape, offset, orientation } = shapeInfo);
the round parentheses are syntax. One can do without only when the variable is being declared. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#syntax
I was personally not familiar with this syntax and found out the hard way :-)
Ok, my error. Thanks for clarifying, and for the link.
Parentheses are required, because in the absence of a const, let or var, the opening brace for the destructuring assignment will be parsed as an opening brace of a new code block.
Including the parentheses allows the destructing assignment to work correctly.
This can happen, for instance, when a gltf-model has not finished loading, hence a bounding box cannot be calculated. We try again after the object3D has been set in this case, the same as when "shape" is missing.