Wednesday, June 9, 2010

Construction without new

inspired by jQuery
(function(window, undefined) {

 function XElement(node) {
  /// 
  return new XElement.prototype.cnstr(node);
 }
 XElement.prototype =
 {
  cnstr: function(node) {
   this.node = node;
  }
 };
 XElement.prototype.cnstr.prototype = XElement.prototype;
 window.XElement = XElement;
})(window);

No comments:

Post a Comment