_hyperscript
_hyperscript copied to clipboard
Bug: Make `add` command safe for null values
It seems like the add command does not accept null values, as in, I cannot say add [@attribute=true] to <something null>
Here's my example case: I have this hyperscript statement in a behavior
add [@type="button"] to <button/> in me
In HTML, if this behavior is called on a node that does not contain any buttons, this breaks, complaining that <button/> in me evaluates to null.
I think there are already other workarounds to use for this, for instance, the tell command should handle this better. But it would be nice for add to handle this gracefully, too.