diff --git a/lib/wasm-parser.mjs b/lib/wasm-parser.mjs index eb9854a..fc69b81 100644 --- a/lib/wasm-parser.mjs +++ b/lib/wasm-parser.mjs @@ -277,9 +277,9 @@ var require_index_cjs = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+ieee754@1.11.6/node_modules/@webassemblyjs/ieee754/lib/index.js +// node_modules/.pnpm/@webassemblyjs+ieee754@1.12.1/node_modules/@webassemblyjs/ieee754/lib/index.js var require_lib2 = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+ieee754@1.11.6/node_modules/@webassemblyjs/ieee754/lib/index.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+ieee754@1.12.1/node_modules/@webassemblyjs/ieee754/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -309,19 +309,19 @@ var require_lib2 = __commonJS({ return buffer; } function decodeF32(bytes) { - var buffer = Buffer.from(bytes); + var buffer = new Uint8Array(bytes); return (0, _ieee.read)(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32); } function decodeF64(bytes) { - var buffer = Buffer.from(bytes); + var buffer = new Uint8Array(bytes); return (0, _ieee.read)(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64); } } }); -// node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/decoder.js +// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/decoder.js var require_decoder = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/decoder.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/decoder.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -383,9 +383,9 @@ var require_decoder = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/encoder.js +// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/encoder.js var require_encoder = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/encoder.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/encoder.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -470,9 +470,9 @@ var require_encoder = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/index.js +// node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/index.js var require_lib3 = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+utf8@1.11.6/node_modules/@webassemblyjs/utf8/lib/index.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+utf8@1.12.1/node_modules/@webassemblyjs/utf8/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -3054,9 +3054,9 @@ var require_signatures = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.11.6/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js +// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.12.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js var require_section = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.11.6/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.12.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/section.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -3088,9 +3088,9 @@ var require_section = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.11.6/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js +// node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.12.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js var require_lib6 = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.11.6/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+helper-wasm-bytecode@1.12.1/node_modules/@webassemblyjs/helper-wasm-bytecode/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -3381,6 +3381,11 @@ var require_lib6 = __commonJS({ 189: createSymbolObject("reinterpret/f64", "i64"), 190: createSymbolObject("reinterpret/i32", "f32"), 191: createSymbolObject("reinterpret/i64", "f64"), + 192: createSymbolObject("extend8_s", "i32"), + 193: createSymbolObject("extend16_s", "i32"), + 194: createSymbolObject("extend8_s", "i64"), + 195: createSymbolObject("extend16_s", "i64"), + 196: createSymbolObject("extend32_s", "i64"), // Atomic Memory Instructions 65024: createSymbol("memory.atomic.notify", 1), 65025: createSymbol("memory.atomic.wait32", 1), @@ -4291,9 +4296,9 @@ var require_lib7 = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/bits.js +// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bits.js var require_bits = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/bits.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bits.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -4381,9 +4386,9 @@ var require_bits = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/bufs.js +// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bufs.js var require_bufs = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/bufs.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/bufs.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true @@ -4424,7 +4429,7 @@ var require_bufs = __commonJS({ if (result) { bufPool[length] = void 0; } else { - result = new Buffer(length); + result = new Uint8Array(length); } result.fill(0); return result; @@ -4440,7 +4445,9 @@ var require_bufs = __commonJS({ return buffer; } var newBuf = alloc(length); - buffer.copy(newBuf); + for (var i = 0; i <= buffer.length; i++) { + newBuf[i] = buffer[i]; + } free(buffer); return newBuf; } @@ -4506,15 +4513,21 @@ var require_bufs = __commonJS({ } var lowWord = value % BIT_32; var highWord = Math.floor(value / BIT_32); - buffer.writeUInt32LE(lowWord, 0); - buffer.writeUInt32LE(highWord, 4); + buffer[0] = lowWord & 255; + buffer[1] = lowWord >> 8 & 255; + buffer[2] = lowWord >> 16 & 255; + buffer[3] = lowWord >> 24 & 255; + buffer[4] = highWord & 255; + buffer[5] = highWord >> 8 & 255; + buffer[6] = highWord >> 16 & 255; + buffer[7] = highWord >> 24 & 255; } } }); -// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/leb.js +// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/leb.js var require_leb = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/leb.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/leb.js"(exports) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; @@ -4660,10 +4673,12 @@ var require_leb = __commonJS({ return decodeBufferCommon(encodedBuffer, index, true); } function encodeInt32(num) { - var buf = bufs.alloc(4); - buf.writeInt32LE(num, 0); + var buf = new Uint8Array(4); + buf[0] = num & 255; + buf[1] = num >> 8 & 255; + buf[2] = num >> 16 & 255; + buf[3] = num >> 24 & 255; var result = encodeIntBuffer(buf); - bufs.free(buf); return result; } function decodeInt32(encodedBuffer, index) { @@ -4708,10 +4723,12 @@ var require_leb = __commonJS({ return decodeBufferCommon(encodedBuffer, index, false); } function encodeUInt32(num) { - var buf = bufs.alloc(4); - buf.writeUInt32LE(num, 0); + var buf = new Uint8Array(4); + buf[0] = num & 255; + buf[1] = num >> 8 & 255; + buf[2] = num >> 16 & 255; + buf[3] = num >> 24 & 255; var result = encodeUIntBuffer(buf); - bufs.free(buf); return result; } function decodeUInt32(encodedBuffer, index) { @@ -4762,9 +4779,9 @@ var require_leb = __commonJS({ } }); -// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/index.js +// node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/index.js var require_lib8 = __commonJS({ - "node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/index.js"(exports) { + "node_modules/.pnpm/@webassemblyjs+leb128@1.12.1/node_modules/@webassemblyjs/leb128/lib/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true diff --git a/package.json b/package.json index c228ead..a3d0f05 100644 --- a/package.json +++ b/package.json @@ -75,5 +75,11 @@ "vite": "^5.2.7", "vitest": "^1.4.0" }, + "resolutions": { + "@webassemblyjs/helper-wasm-bytecode": "1.12.1", + "@webassemblyjs/ieee754": "1.12.1", + "@webassemblyjs/leb128": "1.12.1", + "@webassemblyjs/utf8": "1.12.1" + }, "packageManager": "pnpm@8.15.5" -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e542aba..ce15b76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,12 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +overrides: + '@webassemblyjs/helper-wasm-bytecode': 1.12.1 + '@webassemblyjs/ieee754': 1.12.1 + '@webassemblyjs/leb128': 1.12.1 + '@webassemblyjs/utf8': 1.12.1 + dependencies: knitwork: specifier: ^1.0.0 @@ -1525,7 +1531,7 @@ packages: resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} dependencies: '@webassemblyjs/helper-numbers': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.12.1 dev: true /@webassemblyjs/floating-point-hex-parser@1.11.6: @@ -1544,24 +1550,24 @@ packages: '@xtuc/long': 4.2.2 dev: true - /@webassemblyjs/helper-wasm-bytecode@1.11.6: - resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==} + /@webassemblyjs/helper-wasm-bytecode@1.12.1: + resolution: {integrity: sha512-flsRYmCqN2ZJmvAyNxZXPPFkwKoezeTUczytfBovql8cOjYTr6OTcZvku4UzyKFW0Kj+PgD+UaG8/IdX31EYWg==} dev: true - /@webassemblyjs/ieee754@1.11.6: - resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==} + /@webassemblyjs/ieee754@1.12.1: + resolution: {integrity: sha512-fcrUCqE2dVldeVAHTWFiTiKMS9ivc5jOgB2c30zYOZnm3O54SWeMJWS/HXYK862we2AYHtf6GYuP9xG9J+5zyQ==} dependencies: '@xtuc/ieee754': 1.2.0 dev: true - /@webassemblyjs/leb128@1.11.6: - resolution: {integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==} + /@webassemblyjs/leb128@1.12.1: + resolution: {integrity: sha512-jOU6pTFNf7aGm46NCrEU7Gj6cVuP55T7+kyo5TU/rCduZ5EdwMPBZwSwwzjPZ3eFXYFCmC5wZdPZN0ZWio6n4Q==} dependencies: '@xtuc/long': 4.2.2 dev: true - /@webassemblyjs/utf8@1.11.6: - resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==} + /@webassemblyjs/utf8@1.12.1: + resolution: {integrity: sha512-zcZvnAY3/M28Of012dksIfC26qZQJlj2PQCCvxqlsRJHOYtasp+OvK8nRcg11TKzAAv3ja7Y0NEBMKAjH6ljnw==} dev: true /@webassemblyjs/wasm-parser@1.12.1: @@ -1569,10 +1575,10 @@ packages: dependencies: '@webassemblyjs/ast': 1.12.1 '@webassemblyjs/helper-api-error': 1.11.6 - '@webassemblyjs/helper-wasm-bytecode': 1.11.6 - '@webassemblyjs/ieee754': 1.11.6 - '@webassemblyjs/leb128': 1.11.6 - '@webassemblyjs/utf8': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.12.1 + '@webassemblyjs/ieee754': 1.12.1 + '@webassemblyjs/leb128': 1.12.1 + '@webassemblyjs/utf8': 1.12.1 dev: true /@xtuc/ieee754@1.2.0: