Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,27 @@
'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
common.skipIf32Bits();
const assert = require('assert');
const size = 2 ** 31;
try {
const buf = Buffer.allocUnsafe(size);
const blob = new Blob([buf]);
const slicedBlob = blob.slice(size - 1, size);
assert.strictEqual(slicedBlob.size, 1);
} catch (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()');
}
throw e;
}