Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions test/pummel/test-blob-slice-with-large-size.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
'use strict';

// This tests that Blob.prototype.slice() works correctly when the size of the
// Blob is outside the range of 32-bit signed integers.
const common = require('../common');

// Buffer with size > INT32_MAX
Expand All @@ -14,8 +17,11 @@ try {
const slicedBlob = blob.slice(size - 1, size);
assert.strictEqual(slicedBlob.size, 1);
} catch (e) {
if (e.code !== 'ERR_MEMORY_ALLOCATION_FAILED') {
throw e;
if (e.code === 'ERR_MEMORY_ALLOCATION_FAILED') {
common.skip('insufficient space for Buffer.allocUnsafe');
}
if (/Array buffer allocation failed/.test(e.message)) {
common.skip('insufficient space for Blob.prototype.slice()');
}
common.skip('insufficient space for Buffer.allocUnsafe');
throw e;
}
Loading