You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to discuss error compatibility with the Web Cryptography API. The WebCrypto definition of getRandomValues specifies the following exceptions are thrown:
If array is not of an integer type (i.e., Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array or Uint8ClampedArray), throw a TypeMismatchError and terminate the algorithm.
If the byteLength of array is greater than 65536, throw a QuotaExceededError and terminate the algorithm.
The current proposal uses TypeError instead of TypeMismatchError and RangeError instead of QuotaExceededError, so as not to introduce new Error classes that have only one use in the spec. However, should #2 land this deviation could be considered a web-compat issue.
I am looking for suggestions to address this, either from TC39 members or from those involved with the WebCrypto specification.
Ideally, I would like to avoid redundancy (i.e. TypeMismatchError seems like a redundant form of TypeError), but I also do not want to break existing user code.
The text was updated successfully, but these errors were encountered:
We need to discuss error compatibility with the Web Cryptography API. The WebCrypto definition of getRandomValues specifies the following exceptions are thrown:
The current proposal uses
TypeError
instead ofTypeMismatchError
andRangeError
instead ofQuotaExceededError
, so as not to introduce new Error classes that have only one use in the spec. However, should #2 land this deviation could be considered a web-compat issue.I am looking for suggestions to address this, either from TC39 members or from those involved with the WebCrypto specification.
Ideally, I would like to avoid redundancy (i.e.
TypeMismatchError
seems like a redundant form ofTypeError
), but I also do not want to break existing user code.The text was updated successfully, but these errors were encountered: