A read on a WebGL overload

Some folks on the Edge team are debating how to handle this case from WebGL when passed the literal undefined as param 2:


    void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
    void bufferData(GLenum target, BufferDataSource? data, GLenum usage);


typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
typedef long long GLsizeiptr



>From my read on WebIDL, the second params in each of these overloads does not pass the distinguishability test:



1.       Numeric type + buffer source types are not distinguishable

2.       Each member of the BufferDataSource union type is not distinguishable

3.       Req. 3 is not applicable.



Does this constitute a violation of WebIDL? Or did I read this wrong? If I re-work the definition as:

    void bufferData(GLenum target, (GLsizeiptr or BufferDataSource?) dataOrSize, GLenum usage);

then I think it becomes clear according to the conversion rules for union types, to pass null to the implementation.

Received on Tuesday, 29 September 2015 21:17:43 UTC