summaryrefslogtreecommitdiff
path: root/lib/_stream_readable.js
diff options
context:
space:
mode:
authorZYSzys <zyszys98@gmail.com>2019-07-05 15:54:34 +0800
committerRich Trott <rtrott@gmail.com>2019-07-14 22:27:33 -0700
commit6c430b48b9dff238995aeffe3626bd8b156f563d (patch)
treec49eeb324db47f42257ef2cad0d94dfb309e8f22 /lib/_stream_readable.js
parent461bf36d701f3f7c669e2d916d5a5bc17fc447bf (diff)
downloadandroid-node-v8-6c430b48b9dff238995aeffe3626bd8b156f563d.tar.gz
android-node-v8-6c430b48b9dff238995aeffe3626bd8b156f563d.tar.bz2
android-node-v8-6c430b48b9dff238995aeffe3626bd8b156f563d.zip
stream: use readableEncoding public api for child_process
PR-URL: https://github.com/nodejs/node/pull/28548 Refs: https://github.com/nodejs/node/issues/445 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/_stream_readable.js')
-rw-r--r--lib/_stream_readable.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index d2de4122bb..5b73646db8 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -1075,6 +1075,13 @@ Object.defineProperty(Readable.prototype, 'readableObjectMode', {
}
});
+Object.defineProperty(Readable.prototype, 'readableEncoding', {
+ enumerable: false,
+ get() {
+ return this._readableState ? this._readableState.encoding : null;
+ }
+});
+
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This function is designed to be inlinable, so please take care when making