Re: Feature-detectable API extensions?

On Aug 27, 2013, at 2:21 PM, Joshua Bell wrote:

> On Tue, Aug 27, 2013 at 2:12 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 8/27/13 5:10 PM, Norbert Lindenberg wrote:
> Are there argument values for the second argument that are invalid and will result in an exception?
> 
> In this case, yes: passing "" or 0 would throw.
> 
> 
> Is Norbert asking about the existing IDBCursor continue() method?
> 
> The current IDL is |void continue(optional any key);| and extra arguments don't cause implementations to throw.

Getting back to Boris question concerning 'length'...

Based upon the above signature, IDBCursor.prototype.continue.length should be 0.  I verified this on FF.

void continue(any key, optional dictionary opts {string primaryKey);

according to the ES6 rules (assuming that the second argument is defined as a ES6 default value parameter) the value of the 'length' of the new form should be 1.

So the value of the 'length' property could be used to sniff for the new capability.

Allen

Received on Tuesday, 27 August 2013 22:04:26 UTC