On Thu Jul 27 13:13:44 2023 +0000, Gabriel Ivăncescu wrote:
I think it's one of those things that are self explanatory. The job of the constructor is to create an instance of the mutation observer object. If the result is discarded (NULL pointer), then that can safely be skipped. In javascript code, if you don't assign the return value to anything, the result pointer will be NULL (this only happens to methods/constructors btw, for getters the result must always be non-NULL, and is explicitly freed otherwise if not needed). In terms of js code, the behavior is identical and it shouldn't have any side effects. So here it's just an optimization. Such function *shouldn't* have side effects, other than returning the created object.
personally i disagree, but i will remove this comment.