From: Chris Duncan Date: Thu, 15 Oct 2026 17:38:54 +0000 (-0700) Subject: Create WASM module directly from imported bytes. Fix error imports. X-Git-Tag: v2.0.0~1^2~21 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=6822859b6b278fe1869d0e11878df0ae61d52656;p=nano25519.git Create WASM module directly from imported bytes. Fix error imports. --- diff --git a/src/lib/wasm.ts b/src/lib/wasm.ts index c0a7538..b09cfdd 100644 --- a/src/lib/wasm.ts +++ b/src/lib/wasm.ts @@ -3,8 +3,8 @@ //@ts-expect-error import nano25519_wasm from '../../build/nano25519.wasm' -import { abort, errorCodes, } from './errors' -import { Bytes, Nano25519MutexError, Nano25519TypeError, Words, byteLength, copy, isLE, objectFreeze, words, } from './primordials' +import { abort, errorCodes, Nano25519MutexError, Nano25519TypeError, } from './errors' +import { Bytes, Words, byteLength, isLE, objectFreeze, words, } from './primordials' type Exports = WebAssembly.Instance['exports'] & { clearMemory: () => void @@ -66,8 +66,7 @@ export const Mutex = { } } -const wasm = copy(nano25519_wasm) -const module = new WebAssembly.Module(wasm) +const module = new WebAssembly.Module(nano25519_wasm) const instance = new WebAssembly.Instance(module, { env: { abort } }) const exports = instance.exports as Exports