Re: XHR responseArrayBuffer attribute: suggestion to replace "asBlob" with "responseType"

On Nov 1, 2010, at 1:06 PM, Olli Pettay wrote:

>>> ...But the existing responseText and responseXML would still work as
>>> they work atm? They would be basically the old,
>>> sort-of-deprecated-API? If developer wants to get stringified value
>>> from ArrayBuffer response, she/he could use .responseText?
>>> 
>>> (Browsers could actually warn in the error console if use of old
>>> and new API is mixed)
>> 
>> I think we could go one step further and throw if the author used
>> responseText or responseXML and then tried to use responseObject or
>> responseType, and vice versa. Doing so would steer authors into the
>> modern APIs and would make the implementor's job easier.
> 
> I doubt throwing an exception would make implementor's job
> significantly easier. And based on my experience in
> deprecating some event handling related methods, posting
> warnings about deprecated API to error console is
> surprisingly effective.

I think they would make the implementation simpler because you wouldn't have to worry about the case of keeping around multiple versions of the data just in case the author tries to use multiple mechanisms. Adding new access mechanisms can get very cumbersome if you have to support every permutation. This might avoid that.

-----
~Chris
cmarrin@apple.com

Received on Monday, 1 November 2010 22:36:33 UTC