Skip to content

Commit d27bcf3

Browse files
author
qiang101.wang
committed
feat:not use lz4
1 parent ee106bc commit d27bcf3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bin/wbc_lib.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var lz4 = require('lz4');
21
const path = require('path');
32

43
//each part of header length
@@ -108,7 +107,10 @@ class Wbc {
108107
generateBody(oriBody) {
109108
let pointer = 0;
110109
//use lz4 to compress quickJs bytecode
111-
var bodyChunk = lz4.encode(oriBody);
110+
//以后要压缩时直接放开使用,wbc的结构暂且不做变更,防止后面会使用其他的压缩算法减少bytecode的大小
111+
// var bodyChunk = lz4.encode(oriBody);
112+
// let length = BODY_LENGTH + BODY_CHUNK_TYPE + bodyChunk.length + BODY_CRC32;
113+
var bodyChunk = oriBody;
112114
let length = BODY_LENGTH + BODY_CHUNK_TYPE + bodyChunk.length + BODY_CRC32;
113115
const bodyBuffer = Buffer.alloc(length);
114116

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"bindings": "^1.5.0",
2727
"commander": "^8.2.0",
2828
"crc32": "^0.2.2",
29-
"lz4": "^0.6.5",
3029
"nan": "^2.15.0",
3130
"node-addon-api": "^4.1.0",
3231
"node-gyp": "^9.0.0",

0 commit comments

Comments
 (0)