mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 18:14:08 +00:00

PR-URL: https://github.com/nodejs/node/pull/41513 Refs: https://coverage.nodejs.org/coverage-74b9baa4265a8f0d/lib/internal/blob.js.html Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
25 lines
600 B
JavaScript
25 lines
600 B
JavaScript
// Flags: --no-warnings
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Blob } = require('buffer');
|
|
|
|
if (common.isFreeBSD)
|
|
common.skip('Oversized buffer make the FreeBSD CI runner crash');
|
|
|
|
try {
|
|
new Blob([new Uint8Array(0xffffffff), [1]]);
|
|
} catch (e) {
|
|
if (
|
|
e.message === 'Array buffer allocation failed' ||
|
|
e.message === 'Invalid typed array length: 4294967295'
|
|
) {
|
|
common.skip(
|
|
'Insufficient memory on this platform for oversized buffer test.'
|
|
);
|
|
} else {
|
|
assert.strictEqual(e.code, 'ERR_BUFFER_TOO_LARGE');
|
|
}
|
|
}
|