Re: IDL: special DOMString that converts to Unicode

Jonas Sicking wrote:
> The APIs Anne listed falls into two categories:
>
> Things that do IO (websocket, XMLHttpRequest)
> Things that convert the data to UTF8 (APIs that produce URLs,
> TextEncoder which is a explicit UTF encoding API)
>
> So I think what you are proposing is exactly what is being done.

Could be, but see my follow-up just sent.

If we need to put a requirement on all implementations of a given 
interface defined in WebIDL, we still might choose not to add a new 
string type. Adding the string type seems to impose another pass over 
the string's code units in the JS binding implementation, when that pass 
might be combined with the implementation's pass over the code units.

In general, it seems to pull an implementation requirement from inside 
and put it on the outside. And it adds a new IDL type. It's not a clean 
win in my view. Is there another way to annotate the interface to say 
"all implementations must satisfy requirement X"? IIRC we have precedent 
for this, not expressed via parameter types.

/be

Received on Monday, 29 October 2012 16:00:43 UTC