A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nodejs/node/commit/53cb29898b below:

fix missing edge case in test-blob-slice-with-large-size · nodejs/node@53cb298 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+9

-3

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+9

-3

lines changed Original file line number Diff line number Diff line change

@@ -1,4 +1,7 @@

1 1

'use strict';

2 + 3 +

// This tests that Blob.prototype.slice() works correctly when the size of the

4 +

// Blob is outside the range of 32-bit signed integers.

2 5

const common = require('../common');

3 6 4 7

// Buffer with size > INT32_MAX

@@ -14,8 +17,11 @@ try {

14 17

const slicedBlob = blob.slice(size - 1, size);

15 18

assert.strictEqual(slicedBlob.size, 1);

16 19

} catch (e) {

17 -

if (e.code !== 'ERR_MEMORY_ALLOCATION_FAILED') {

18 -

throw e;

20 +

if (e.code === 'ERR_MEMORY_ALLOCATION_FAILED') {

21 +

common.skip('insufficient space for Buffer.allocUnsafe');

22 +

}

23 +

if (/Array buffer allocation failed/.test(e.message)) {

24 +

common.skip('insufficient space for Blob.prototype.slice()');

19 25

}

20 -

common.skip('insufficient space for Buffer.allocUnsafe');

26 +

throw e;

21 27

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4