Files
node/doc/api
Sakthipriyan Vairamani eea66e2a7b buffer: fix case of one buffer passed to concat
Fix Buffer.concat() so a copy is always returned regardless of the
number of buffers that were passed.

Previously if the array length was one then the same same buffer was
returned. This created a special case for the user where there was a
chance mutating the buffer returned by .concat() could mutate the buffer
passed in.

Also fixes an inconsistency when throwing if an array member was not a
Buffer instance. For example:

    Buffer.concat([42]);      // Returns 42
    Buffer.concat([42, 1]);  // Throws a TypeError

Now .concat() will always throw if an array member is not a Buffer
instance.

See: https://github.com/nodejs/io.js/issues/1891
PR-URL: https://github.com/nodejs/io.js/pull/1937
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-08-04 11:56:12 -07:00
..
2015-02-10 17:58:10 -08:00
2015-02-10 17:58:10 -08:00
2015-02-27 14:23:01 -08:00
2015-04-11 06:47:30 +02:00
2015-02-27 14:23:01 -08:00
2015-02-27 14:23:01 -08:00
2015-05-02 14:07:21 +02:00
2010-11-07 17:22:56 -08:00
2015-06-05 22:58:14 -04:00
2015-02-27 14:23:01 -08:00
2015-04-30 19:44:49 +02:00
2015-02-27 14:23:01 -08:00
2015-02-27 14:23:01 -08:00
2015-05-25 13:50:53 +02:00
2015-04-28 10:12:13 -04:00
2015-03-13 23:14:20 +01:00
2015-02-27 14:23:01 -08:00