Skip to content

Commit

Permalink
fix: patch to use Buffer.alloc instead of new Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 16, 2024
1 parent fb1e7ee commit d6262d7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
18 changes: 9 additions & 9 deletions lib/wasm-parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4297,9 +4297,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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/node_modules/@webassemblyjs/leb128/lib/bits.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
Expand Down Expand Up @@ -4387,9 +4387,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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/node_modules/@webassemblyjs/leb128/lib/bufs.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
Expand Down Expand Up @@ -4430,7 +4430,7 @@ var require_bufs = __commonJS({
if (result) {
bufPool[length] = void 0;
} else {
result = new Buffer(length);
result = Buffer.alloc(length);
}
result.fill(0);
return result;
Expand Down Expand Up @@ -4518,9 +4518,9 @@ var require_bufs = __commonJS({
}
});

// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6/node_modules/@webassemblyjs/leb128/lib/leb.js
// node_modules/.pnpm/@webassemblyjs+leb128@1.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/node_modules/@webassemblyjs/leb128/lib/leb.js"(exports) {
"use strict";
function _typeof(obj) {
"@babel/helpers - typeof";
Expand Down Expand Up @@ -4768,9 +4768,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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/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.11.6_patch_hash=irpstnnlcpe4xzsb345am6kfk4/node_modules/@webassemblyjs/leb128/lib/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"packageManager": "pnpm@8.14.1",
"pnpm": {
"patchedDependencies": {
"@webassemblyjs/helper-wasm-bytecode@1.11.6": "patches/@webassemblyjs__helper-wasm-bytecode@1.11.6.patch"
"@webassemblyjs/helper-wasm-bytecode@1.11.6": "patches/@webassemblyjs__helper-wasm-bytecode@1.11.6.patch",
"@webassemblyjs/leb128@1.11.6": "patches/@webassemblyjs__leb128@1.11.6.patch"
}
}
}
13 changes: 13 additions & 0 deletions patches/@webassemblyjs__leb128@1.11.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/bufs.js b/lib/bufs.js
index f9a176ed87d84c833d2867bf9cf1e79d2d41823f..1ea71634e17fabfd15bce95f17894dfb7d9a4862 100644
--- a/lib/bufs.js
+++ b/lib/bufs.js
@@ -98,7 +98,7 @@ function alloc(length) {
if (result) {
bufPool[length] = undefined;
} else {
- result = new Buffer(length);
+ result = Buffer.alloc(length);
}

result.fill(0);
8 changes: 6 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d6262d7

Please sign in to comment.