0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/doc/api
Marcos Casagrande df339bccf2 stream: convert string to Buffer when calling unshift(<string>)
`readable.unshift` can take a string as an argument, but that
string wasn't being converted to a Buffer, which caused a
<TypeError: Argument must be a buffer> in some cases. Also if a
string was passed, that string was coerced to utf8 encoding.

A second optional argument `encoding` was added to `unshift` to
fix the encoding issue.

Fixes: https://github.com/nodejs/node/issues/27192
PR-URL: https://github.com/nodejs/node/pull/27194
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-02 16:56:13 +02:00
..
addons.md doc: hello addon example should return "world" 2019-03-05 23:54:31 +01:00
assert.md doc: fix the wrong name of AssertionError 2019-06-02 10:11:24 +02:00
async_hooks.md src: do not reuse async resource in http parsers 2019-04-22 11:51:46 -07:00
buffer.md 2019-04-23, Version 12.0.0 (Current) 2019-04-23 16:46:54 +01:00
child_process.md doc: correct parameter type on 'subprocess.kill([signal])' 2019-05-20 23:00:31 +08:00
cli.md doc: add missing --experimental-wasm-modules docs 2019-05-31 09:33:45 -04:00
cluster.md benchmark,doc,lib: capitalize more comments 2019-03-27 17:20:06 +01:00
console.md benchmark,doc,lib: capitalize more comments 2019-03-27 17:20:06 +01:00
crypto.md doc: improve CCM example 2019-05-06 21:40:07 +02:00
debugger.md
deprecations.md child_process: runtime deprecate _channel 2019-05-31 11:13:25 -04:00
dgram.md 2019-04-23, Version 12.0.0 (Current) 2019-04-23 16:46:54 +01:00
dns.md doc: dns.lookup() documentation error code 2019-05-13 16:57:07 -07:00
documentation.md doc: simplify system call material in doc overview 2019-06-02 00:10:01 +02:00
domain.md benchmark,doc,lib: capitalize more comments 2019-03-27 17:20:06 +01:00
errors.md stream: convert string to Buffer when calling unshift(<string>) 2019-06-02 16:56:13 +02:00
esm.md esm: remove experimental status from JSON modules 2019-05-22 04:06:34 -04:00
events.md 2019-03-28, Version 11.13.0 (Current) 2019-03-28 20:23:29 +01:00
fs.md doc: improve explanation for directory with fs.rename() 2019-06-02 11:25:59 +02:00
globals.md lib: move queueMicrotask to stable 2019-03-08 08:19:38 -06:00
http2.md doc,test: clarify that Http2Stream is destroyed after data is read 2019-05-28 10:59:53 -07:00
http.md http, http2: remove default server timeout 2019-05-09 08:54:04 -07:00
https.md http: servername === false should disable SNI 2019-04-30 06:43:22 -07:00
index.md doc: add node-report documentation 2019-01-18 10:35:55 +05:30
inspector.md doc: add inspector API example for heapdump 2019-03-11 06:19:11 +01:00
intl.md
modules.md doc: clarify wording in modules.md 2019-06-02 11:57:01 +02:00
n-api.md 2019-05-28, Version 10.16.0 'Dubnium' (LTS) 2019-05-28 23:45:42 +01:00
net.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
os.md doc: fix section sorting, add link reference 2019-04-03 22:44:53 +03:00
path.md doc: fix extname with the correct description 2019-04-20 17:01:09 +03:00
perf_hooks.md benchmark,doc,lib,test: capitalize comments 2019-03-10 00:44:40 +01:00
policy.md doc: fix metadata for v11.8.0 doc changes 2019-01-25 19:09:26 -08:00
process.md 2019-04-23, Version 12.0.0 (Current) 2019-04-23 16:46:54 +01:00
punycode.md
querystring.md benchmark,doc,lib: capitalize more comments 2019-03-27 17:20:06 +01:00
readline.md 2019-04-11, Version 11.14.0 (Current) 2019-04-11 17:56:55 +01:00
repl.md 2019-05-21, Version 12.3.0 (Current) 2019-05-21 21:23:52 +02:00
report.md report: print common items first for readability 2019-04-27 12:04:36 +02:00
stream.md stream: convert string to Buffer when calling unshift(<string>) 2019-06-02 16:56:13 +02:00
string_decoder.md
synopsis.md
timers.md benchmark,doc,lib: capitalize more comments 2019-03-27 17:20:06 +01:00
tls.md tls: support the hints option 2019-05-25 08:50:02 +02:00
tracing.md
tty.md doc: specify return type for tty.isatty() 2019-04-09 23:06:46 +03:00
url.md
util.md util: include reference anchor for circular structures 2019-05-20 14:20:59 +02:00
v8.md src: export number_of_native_contexts and number_of_detached_contexts 2019-05-30 15:25:55 +02:00
vm.md
worker_threads.md 2019-05-21, Version 12.3.0 (Current) 2019-05-21 21:23:52 +02:00
zlib.md benchmark,doc,lib: capitalize more comments 2019-03-27 17:20:06 +01:00