readline: fix calling constructor without new
authorAlex Kocharin <alex@kocharin.ru>
Thu, 9 Apr 2015 15:55:26 +0000 (18:55 +0300)
committerBen Noordhuis <info@bnoordhuis.nl>
Fri, 10 Apr 2015 08:56:19 +0000 (10:56 +0200)
commitf0bf6bb024f86412c2dbe6f0ea1f984a3a25ec2a
tree79565c2b2bee5f4f9b1728ab125aa9823b41e579
parent8bc8bd4bc206d23fe8936608cdd5450cf037b586
readline: fix calling constructor without new

Previously, we detected options object based on amount of arguments
supplied. But if we're calling readline without new operator,
constructor gets re-called and will always have 4 arguments.

PR-URL: https://github.com/iojs/io.js/pull/1385
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/readline.js
test/parallel/test-readline-interface.js