I saw some PRs that fix name anonymous functions.
Should switch to below way?
/lib/stream.js
class Stream extends EE {
constructor () {
super()
}
pipe () {
// ...
}
}
Only if it is already a class. If not, please don't. (The large change will likely make backporting far more difficult.)
The change would also break creation of objects without new.
@addaleax
creation of objects
module.exports = {
pipe () {
},
end () {
}
}
@fundon Stream() wouldn’t work because it’s a class :/
@addaleax Do you talk about this?
var stream = require('stream')
undefined
> stream.Stream()
undefined
@fundon If you turn Stream into a proper class, that breaks things like Stream.call(this); in the Writable constructor. You can somewhat work around that but once you’re at the double inheritance of Duplexes, things get really tricky…
Most helpful comment
Only if it is already a class. If not, please don't. (The large change will likely make backporting far more difficult.)