From 4e9e0d339efa46316d90d6f2618afd0c0fc6cd34 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 15 Oct 2018 01:32:16 +0200 Subject: [PATCH] stream: undo internalBinding() conversion in compat mechanism PR-URL: https://github.com/nodejs/node/pull/23662 Refs: https://github.com/nodejs/node/pull/22675 Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: Weijia Wang Reviewed-By: Matteo Collina Reviewed-By: Ruben Bridgewater --- lib/stream.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/stream.js b/lib/stream.js index 52c0e50582ddb2..f7e47df73145be 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -49,7 +49,10 @@ try { } else { // This throws for Node < 4.2.0 because there's no util binding and // returns undefined for Node < 7.4.0. - Stream._isUint8Array = internalBinding('util').isUint8Array; + // Please do not convert process.binding() to internalBinding() here. + // This is for compatibility with older versions when loaded as + // readable-stream. + Stream._isUint8Array = process.binding('util').isUint8Array; } } catch (e) { }