Files
node/lib
Anna Henningsen 8f90dcc1b8 buffer: throw on negative .allocUnsafe() argument
Add a check for `size < 0` to `assertSize()`, as passing a negative
value almost certainly indicates a programming error.

This also lines up the behaviour of `.allocUnsafe()` with the ones
of `.alloc()` and `.allocUnsafeSlow()` (which previously threw errors
from the Uint8Array constructor).

Notably, this also affects `Buffer()` calls with negative arguments.

PR-URL: https://github.com/nodejs/node/pull/7079
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
2016-08-08 15:04:21 +02:00
..
2015-10-08 17:32:08 -07:00
2016-05-18 02:12:28 -04:00
2016-06-17 17:03:49 +02:00
2016-08-06 19:41:35 +05:30
2016-06-01 18:57:45 -04:00
2016-06-29 17:10:53 -07:00