Skip to content

v0.1.1

Latest

Choose a tag to compare

@Visol-456 Visol-456 released this 15 Aug 07:55

修复

  • 修复真实浏览器非 secure context 下 polyfill 调用 crypto.getRandomValues 时抛出 TypeError: Illegal invocation 的问题。
  • 根因:原实现对原生 Web Crypto 方法做了解构调用,丢失了 this 绑定。
  • 修复:polyfill 内部将 getRandomValues 绑定到 Crypto 实例后再调用。

测试

  • 新增防回归测试:模拟要求 this 的 native-like getRandomValues,验证 polyfill 后的 randomUUID() 正常返回合法 UUID v4。
  • 全量测试:4/4 通过。
  • 构建:tsc + tsdown 全绿。

安装

dsh plugin add @visol-456/dsh-web-compat@0.1.1