JavaScript misfeature
Today a friend of mine checked in code that read: var stream = new fs.createReadStream(filename); The ‘new’ in the code was not intended. Our expansive auto tests passed without a glitch. In fact, the ‘stream’ variable was correctly set to the stream – exactly like if the ‘new’ keyword was not present. It turns out …