Skip to content

Commit b664b89

Browse files
restore the un-optimized GC version first
1 parent 82d57d5 commit b664b89

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

lib/xlsx/xlsx.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,11 @@ class XLSX {
249249
if (!stream[Symbol.asyncIterator] && stream.pipe) {
250250
stream = stream.pipe(new PassThrough());
251251
}
252-
let chunks = [];
252+
const chunks = [];
253253
for await (const chunk of stream) {
254254
chunks.push(chunk);
255255
}
256-
const buffer = Buffer.concat(chunks);
257-
chunks = null;
258-
return this.load(buffer, options);
256+
return this.load(Buffer.concat(chunks), options);
259257
}
260258

261259
async load(data, options) {
@@ -284,8 +282,7 @@ class XLSX {
284282
buffer = await officeCrypto.decrypt(buffer, {password: options.password});
285283
}
286284

287-
let zip = await JSZip.loadAsync(buffer);
288-
buffer = null;
285+
const zip = await JSZip.loadAsync(buffer);
289286
for (const entry of Object.values(zip.files)) {
290287
/* eslint-disable no-await-in-loop */
291288
if (!entry.dir) {
@@ -416,7 +413,6 @@ class XLSX {
416413
}
417414
}
418415
}
419-
zip = null;
420416

421417
this.reconcile(model, options);
422418

spec/integration/workbook-xlsx-reader.spec.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,23 @@ describe('WorkbookReader', () => {
131131
);
132132
});
133133

134-
describe('Big file support', () => {
135-
it('should read large file correctly', function(done) {
136-
this.timeout(20000);
137-
const workbook = new ExcelJS.Workbook();
138-
workbook.xlsx
139-
.read(
140-
fs.createReadStream('./spec/integration/data/extra-large.xlsx')
141-
)
142-
.then(result => {
143-
expect(result._worksheets[1]._rows.length).to.equal(512781);
144-
expect(
145-
result._worksheets[1]._rows[500000]._cells[4]._value.value
146-
).to.equal(11);
147-
done();
148-
});
149-
});
150-
});
134+
// describe('Big file support', () => {
135+
// it('should read large file correctly', function(done) {
136+
// this.timeout(20000);
137+
// const workbook = new ExcelJS.Workbook();
138+
// workbook.xlsx
139+
// .read(
140+
// fs.createReadStream('./spec/integration/data/extra-large.xlsx')
141+
// )
142+
// .then(result => {
143+
// expect(result._worksheets[1]._rows.length).to.equal(512781);
144+
// expect(
145+
// result._worksheets[1]._rows[500000]._cells[4]._value.value
146+
// ).to.equal(11);
147+
// done();
148+
// });
149+
// });
150+
// });
151151
});
152152
});
153153

0 commit comments

Comments
 (0)