Re: [IndexedDB] KeyRange factory methods

On Thu, Dec 16, 2010 at 2:52 PM, Pablo Castro
<Pablo.Castro@microsoft.com> wrote:
> I was going to file a bug on this but wanted to make sure I'm not missing something first.
>
> All the factory methods for ranges (e.g. bound, lowerBound, etc.) are in the IDBKeyRangeConstructors interface now, but I don't see the interface referenced anywhere. Who implements this interface, the Window object, IDBFactory[Sync], something else?

>From the spec:

"To construct a key range a set of constructors are available. In
languages with interface objects [WEBIDL], these constructors are
available on the IDBKeyRange interface object. In other languages
these constructors are available through language specific means, for
example as static functions"

But I see that I forgot to say that the IDBKeyRangeConstructors
interface implements these constructors.

However WebIDL nowadays have support for "static" so there is no
longer a need for a separate interface. We should just do

interface IDBKeyRange {
    readonly attribute any     lower;
    readonly attribute any     upper;
    readonly attribute boolean lowerOpen;
    readonly attribute boolean upperOpen;

    static IDBKeyRange only (in any value);
    static IDBKeyRange lowerBound (in any bound, in optional boolean open);
    static IDBKeyRange upperBound (in any bound, in optional boolean open);
    static IDBKeyRange bound (in any lower, in any upper,
                                 in optional boolean lowerOpen,
                                 in optional boolean upperOpen);
};

/ Jonas

Received on Friday, 17 December 2010 00:07:54 UTC