GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: remove lines setting indexes to integer value · nodejs/node@f1bc994

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • blob.js
  • test/pummel
    • test-blob-slice-with-large-size.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/blob.js‎

Copy file name to clipboardExpand all lines: lib/internal/blob.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,12 @@ class Blob {
243243
} else {
244244
start = MathMin(start, this[kLength]);
245245
}
246-
start |= 0;
247246

248247
if (end < 0) {
249248
end = MathMax(this[kLength] + end, 0);
250249
} else {
251250
end = MathMin(end, this[kLength]);
252251
}
253-
end |= 0;
254252

255253
contentType = `${contentType}`;
256254
if (RegExpPrototypeExec(disallowedTypeCharacters, contentType) !== null) {
Collapse file

‎test/pummel/test-blob-slice-with-large-size.js‎

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
// Buffer with size > INT32_MAX
5+
common.skipIf32Bits();
6+
7+
const assert = require('assert');
8+
9+
const size = 2 ** 31;
10+
11+
try {
12+
const buf = Buffer.allocUnsafe(size);
13+
const blob = new Blob([buf]);
14+
const slicedBlob = blob.slice(size - 1, size);
15+
assert.strictEqual(slicedBlob.size, 1);
16+
} catch (e) {
17+
if (e.code !== 'ERR_MEMORY_ALLOCATION_FAILED') {
18+
throw e;
19+
}
20+
common.skip('insufficient space for Buffer.allocUnsafe');
21+
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.