src: disallow constructor behaviour for native methods by addaleax · Pull Request #26700 · nodejs/node (original) (raw)

I don't think we can simply replace that wholesale though, that could break a lot of hidden use cases.

That's why I didn't do it in #26096, I felt like it should be firstly investigated if some modules rely on some methods/functions being constructors.

@Hakerh400 We can run our ecosystem checking tool on this, but generally, this should be safe to do. None of the methods affected by this are likely to be used as constructors, and I’m not concerned that there could be significant ecosystem usage of this. Plus, this won’t be released until Node 12.