petermichaux / maria

The MVC framework for JavaScript applications. The real MVC. The Smalltalk MVC. The Gang of Four MVC.
BSD 2-Clause "Simplified" License
764 stars 51 forks source link

Update create.js #33

Closed WebReflection closed 11 years ago

WebReflection commented 11 years ago

that Crockford pattern ... I never liked it that much. You can reuse the function since the magic happens when you new and nowhere else.

petermichaux commented 11 years ago

The function is already being reused in the current implementation of maria.create

The only significant change in this pull request is the line

F.prototype = null;

I could add just that line.

WebReflection commented 11 years ago

oh, my bad ... didn't see that. So yes, obj is going to be an object in any case so you can reuse it without causing GC/JIT problems and dropping the prototype after ensures no leaks. Of course smart engines can avoid that but you stated this is going to work in IE6 too :-)