On 9/22/17 1:31 PM, Eric Rahm wrote:
The problem is these were never a null string, they're a voided empty
string.
Sure. In the DOM usage, it's "a string that will convert to JS null
when converting to 'DOMString?'", and not anything about the string
itself being null.
Arguably that API should be taking a maybe param and arguably we
should get rid of the void concept but that's not straightforward.
Yes, on both counts.
There are some complications, as you note, if we want to avoid making
too many string copies, etc. In particular, making something like
"Nullable<nsAString>" (or equivalent with Maybe) work is a bit complicated.
As a workaround for readability I think it would be reasonable to add some
sort of `using NullString = VoidString` to DOMString.h.
That seems pretty reasonable for now.
-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform