summaryrefslogtreecommitdiff
path: root/lib/_stream_transform.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-10-08 14:43:17 -0700
committerisaacs <i@izs.me>2012-12-13 17:00:26 -0800
commit545f5126190acacd14ce54799d1e3c5d6dcd9edb (patch)
tree5db5731af7fb0f33fec79776ee286ac977f1ba5d /lib/_stream_transform.js
parent9b1b85490b6b242aabf84054a0a59ea1cf1c8dbc (diff)
downloadnode-new-545f5126190acacd14ce54799d1e3c5d6dcd9edb.tar.gz
streams2: ctor guards on Stream classes
Diffstat (limited to 'lib/_stream_transform.js')
-rw-r--r--lib/_stream_transform.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js
index 16f2cacb93..abf7479fdc 100644
--- a/lib/_stream_transform.js
+++ b/lib/_stream_transform.js
@@ -77,6 +77,9 @@ function TransformState() {
}
function Transform(options) {
+ if (!(this instanceof Transform))
+ return new Transform(options);
+
Duplex.call(this, options);
// bind output so that it can be passed around as a regular function.