js-platform/node-webrtc — pull request #84 by piranna (2014-02-17 03:24:06+00:00)
Title: Merged internal and public PeerConnection classes

Here you have an example of my proposal to unify internal and public classes, in this case done with the PeerConnection one. As a result of it, not only the code is almost 100 lines smaller and gets simpler and cleaner and more easier to maintain and expand (adding EventTarget events will be trivial), but also it will waste less memory and there are no private attributes accesibles from outside, making it more secure and standard compliant. I have updated the methods parameters names to the current ones on the specification. For the native PeerConnection events onicecandidate and ondatachannel I needed to remove the function names due to conflicts that provocated an infinite recursion, but this will be fixed when EventTarget events get implemented.

Opinions? Comments? Suggestions? If you agree, I can keep working on adding the EventTarget events on this and apply the same code scheme to the other public classes.