(arrayBuffer, offset, length)
| 4 | const assert = require('assert'); |
| 5 | |
| 6 | function test(arrayBuffer, offset, length) { |
| 7 | const uint8Array = new Uint8Array(arrayBuffer, offset, length); |
| 8 | for (let i = 0; i < length; i += 1) { |
| 9 | uint8Array[i] = 1; |
| 10 | } |
| 11 | |
| 12 | const buffer = Buffer.from(arrayBuffer, offset, length); |
| 13 | for (let i = 0; i < length; i += 1) { |
| 14 | assert.strictEqual(buffer[i], 1); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | const acceptableOOMErrors = [ |
| 19 | 'Array buffer allocation failed', |
no test coverage detected
searching dependent graphs…