Instance:SetAttribute errors when passed invalid attribute names. The name must:
be less than or equal to 100 characters;
only contain alphanumeric characters, and in the near future, periods, hyphens, underscores, or forward slashes;
must not use the RBX prefix, which is reserved by Roblox.
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..
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, returnsfalse
(but will still attempt to set all the attributes). In the future, once Rojo's patch visualizer has more rich display ofAttributes
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..