reflect-metadata
reflect-metadata copied to clipboard
Cross-browser error
In 0.1.5, the function GenRandomBytes
was changed - instead of writing an array into a variable, passing it as a parameter to crypto.getRandomValues
and then returning that variable, it now returns the return value of crypto.getRandomValues
directly.
According to the TS lib declaration file, this is correct - but I have found that on certain older browsers (such as the Android browser) crypto.getRandomValues
returns no value and only mutates the parameter. Since version 0.1.5, this library therefore causes a TypeError on these browsers.
I would like to request the change to GenRandomBytes
be reverted in the interest of cross-browser compatibility.
This appears to have been fixed in this PR. https://github.com/rbuckton/reflect-metadata/pull/64/commits/822def6348c2d0b97c84993a77e896b958f7d130 Would be nice if this was merged 😄