[DOMCRYPT] Crypto interface should use WebIDL overloads instead of a 'type check' step in the algorithm

Hi All,

In the draft at https://dvcs.w3.org/hg/domcrypt/raw-file/tip/Overview.html,
the current WebIDL snippet for the Crypto interface is

interface Crypto {
 ArrayBufferView getRandomValues(ArrayBufferView array);
};

And the first step of the algorithm for getRandom values is "If array is
not of an integer type (i.e., Int8Array, Uint8Array, Int16Array,
Uint16Array, Int32Array, or Uint32Array), throw a TypeMismatchError and
abort these steps."

I believe this should be written as

interface Crypto {
  Int8Array getRandomValues(Int8Array array);
  Uint8Array getRandomValues(Uint8Array array);
  Int16Array getRandomValues(Int16Array array);
  Uint16Array getRandomValues(Uint16Array array);
  Int32Array getRandomValues(Int32Array array);
  Uint32Array getRandomValues(Uint32Array array);
};

to use WebIDL overloading instead of the explicit type check step.

- Kyle

Received on Friday, 6 April 2012 03:59:41 UTC