summaryrefslogtreecommitdiff
path: root/lib/stream.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stream.js')
-rw-r--r--lib/stream.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/stream.js b/lib/stream.js
index 9c1ba986d0..0dd44e3a61 100644
--- a/lib/stream.js
+++ b/lib/stream.js
@@ -38,10 +38,16 @@ Stream.Stream = Stream;
// Internal utilities
try {
- Stream._isUint8Array = process.binding('util').isUint8Array;
+ Stream._isUint8Array = require('internal/util/types').isUint8Array;
} catch (e) {
- // This throws for Node < 4.2.0 because there’s no util binding and
- // returns undefined for Node < 7.4.0.
+ // Throws for code outside of Node.js core.
+
+ try {
+ Stream._isUint8Array = process.binding('util').isUint8Array;
+ } catch (e) {
+ // This throws for Node < 4.2.0 because there’s no util binding and
+ // returns undefined for Node < 7.4.0.
+ }
}
if (!Stream._isUint8Array) {