0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00
nodejs/test
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
..
addons
cctest
debugger debugger: improve ESRCH error message 2015-06-05 05:54:19 +02:00
disabled test: fix messages and use return to skip tests 2015-08-03 21:32:48 +05:30
fixtures util: prepend '(node) ' to deprecation messages 2015-07-03 16:32:29 +02:00
gc
internet dgram: make send cb act as "error" event handler 2015-08-04 11:56:12 -07:00
message
parallel buffer: fix case of one buffer passed to concat 2015-08-04 11:56:12 -07:00
pummel test: fix messages and use return to skip tests 2015-08-03 21:32:48 +05:30
sequential test: fix messages and use return to skip tests 2015-08-03 21:32:48 +05:30
testpy test: create temp dir in common.js 2015-06-12 10:27:29 +10:00
timers
.eslintrc tools: enable/add additional eslint rules 2015-06-11 20:27:35 +02:00
common.js test: use common.isWindows consistently 2015-07-31 00:29:36 +05:30