rojo-rbx / rbx-dom

Roblox DOM and (de)serialization implementation in Rust
MIT License
105 stars 42 forks source link

Add name validation to rbx_dom_lua Attributes writer #374

Closed kennethloeffler closed 8 months ago

kennethloeffler commented 8 months ago

Instance:SetAttribute errors when passed invalid attribute names. The name must:

This PR adds validation to rbx_dom_lua's Attributes custom writer to guard against these, and if any fail, returns false (but will still attempt to set all the attributes). In the future, once Rojo's patch visualizer has more rich display of Attributes values, we could return a more detailed error with specific information about which ones failed.

The alternative is throwing the SetAttribute into a protected call, but eh..