unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
465 stars 22 forks source link

fix: ensure Cloudflare webcrypto.getRandomBytes is bound to the correct this object #309

Closed petebacondarwin closed 2 months ago

petebacondarwin commented 2 months ago

It appears that this is the only function in the webcrypto exports list that needs to be bound to its original object.

Note that it must be bound to the webcrypto object even though workerd also exports it on the crypto namespace directly.