Files
node/test/parallel
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
..
2016-07-14 22:07:14 -04:00
2016-07-14 22:07:14 -04:00
2016-07-14 22:07:14 -04:00
2016-07-14 22:07:14 -04:00
2016-07-14 22:07:14 -04:00
2016-04-08 13:58:48 -07:00
2016-07-14 22:07:14 -04:00
2016-07-14 22:07:14 -04:00