| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2a023bf commit 4a3300e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -218,7 +218,7 @@ function fromArrayBuffer(obj, byteOffset, length) { | |||
| 218 | 218 | ||
| 219 | 219 | const maxLength = obj.byteLength - byteOffset; | |
| 220 | 220 | ||
| 221 | - if (maxLength <= 0) | ||
| 221 | + if (maxLength < 0) | ||
| 222 | 222 | throw new RangeError("'offset' is out of bounds"); | |
| 223 | 223 | ||
| 224 | 224 | if (length === undefined) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1458,3 +1458,8 @@ const ubuf = Buffer.allocUnsafeSlow(10); | |||
| 1458 | 1458 | assert(ubuf); | |
| 1459 | 1459 | assert(ubuf.buffer); | |
| 1460 | 1460 | assert.equal(ubuf.buffer.byteLength, 10); | |
| 1461 | + | ||
| 1462 | + // Regression test | ||
| 1463 | + assert.doesNotThrow(() => { | ||
| 1464 | + Buffer.from(new ArrayBuffer()); | ||
| 1465 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments