GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/test/sequential/test-buffer-creation-regression.js at main · ide/node Expand file tree/ Copy pathtest-buffer-creation-regression.jsMore file actions 36 lines (29 loc) · 874 Bytes / Copy pathtest-buffer-creation-regression.jsFile metadata and controls36 lines (29 loc) · 874 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 'use strict'; const common = require('../common'); const assert = require('assert'); function test(arrayBuffer, offset, length) { const uint8Array = new Uint8Array(arrayBuffer, offset, length); for (let i = 0; i < length; i += 1) { uint8Array[i] = 1; } const buffer = Buffer.from(arrayBuffer, offset, length); for (let i = 0; i < length; i += 1) { assert.strictEqual(buffer[i], 1); } } const acceptableOOMErrors = [ 'Array buffer allocation failed', 'Invalid array buffer length', ]; const length = 1000; const offset = 4294967296; /* 1 << 32 */ const size = offset + length; let arrayBuffer; try { arrayBuffer = new ArrayBuffer(size); } catch (e) { if (e instanceof RangeError && acceptableOOMErrors.includes(e.message)) common.skip(`Unable to allocate ${size} bytes for ArrayBuffer`); throw e; } test(arrayBuffer, offset, length); |
| You are visitor 01402792 — 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. |