enum TableKind {
    "externref",
    "anyfunc"
};

dictionary TableDescriptor {
    required TableKind element;
    required [EnforceRange] unsigned long initial;
    [EnforceRange] unsigned long maximum;
};

// https://webassembly.github.io/spec/js-api/#tables
[LegacyNamespace=WebAssembly, Exposed=*]
interface Table {
    constructor(TableDescriptor descriptor, optional any value);

    unsigned long grow([EnforceRange] unsigned long delta, optional any value);

    any get([EnforceRange] unsigned long index);
    undefined set([EnforceRange] unsigned long index, optional any value);

    readonly attribute unsigned long length;
};
