html.js
function (tagName) {
  // HTMLTag is the per-tagName constructor of a HTML.Tag subclass
  var HTMLTag = function (/*arguments*/) {
    // Work with or without `new`.  If not called with `new`,
    // perform instantiation by recursively calling this constructor.
    // We can't pass varargs, so pass no args.
    var instance = (this instanceof HTML.Tag) ? this : new HTMLTag;

    var i = 0;
    var attrs = arguments.length && arguments[0];
    if (attrs && (typeof attrs === 'object')) {
      // Treat vanilla JS object as an attributes dictionary.
      if (! HTML.isConstructedObject(attrs)) {
        instance.attrs = attrs;
        i++;
      } else if (attrs instanceof HTML.Attrs) {
        var array = attrs.value;
        if (array.length === 1) {
          instance.attrs = array[0];
        } else if (array.length > 1) {
          instance.attrs = array;
        }
        i++;
      }
    }


    // If no children, don't create an array at all, use the prototype's
    // (frozen, empty) array.  This way we don't create an empty array
    // every time someone creates a tag without `new` and this constructor
    // calls itself with no arguments (above).
    if (i < arguments.length)
      instance.children = SLICE.call(arguments, i);

    return instance;
  };
  HTMLTag.prototype = new HTML.Tag;
  HTMLTag.prototype.constructor = HTMLTag;
  HTMLTag.prototype.tagName = tagName;

  return HTMLTag;
}
function (tagName) {
  // HTMLTag is the per-tagName constructor of a HTML.Tag subclass
  var HTMLTag = function (/*arguments*/) {
    // Work with or without `new`.  If not called with `new`,
    // perform instantiation by recursively calling this constructor.
    // We can't pass varargs, so pass no args.
    var instance = (this instanceof HTML.Tag) ? this : new HTMLTag;

    var i = 0;
    var attrs = arguments.length && arguments[0];
    if (attrs && (typeof attrs === 'object')) {
      // Treat vanilla JS object as an attributes dictionary.
      if (! HTML.isConstructedObject(attrs)) {
        instance.attrs = attrs;
        i++;
      } else if (attrs instanceof HTML.Attrs) {
        var array = attrs.value;
        if (array.length === 1) {
          instance.attrs = array[0];
        } else if (array.length > 1) {
          instance.attrs = array;
        }
        i++;
      }
    }


    // If no children, don't create an array at all, use the prototype's
    // (frozen, empty) array.  This way we don't create an empty array
    // every time someone creates a tag without `new` and this constructor
    // calls itself with no arguments (above).
    if (i < arguments.length)
      instance.children = SLICE.call(arguments, i);

    return instance;
  };
  HTMLTag.prototype = new HTML.Tag;
  HTMLTag.prototype.constructor = HTMLTag;
  HTMLTag.prototype.tagName = tagName;

  return HTMLTag;
}
function ( tagName ) { // HTMLTag is the per-tagName constructor of a HTML.Tag subclass var HTMLTag = function ( /*arguments*/ ) { // Work with or without `new`.  If not called with `new`, // perform instantiation by recursively calling this constructor. // We can't pass varargs, so pass no args. var instance = ( this instanceof HTML . Tag ) ? this : new HTMLTag ; var i = 0 ; var attrs = arguments . length && arguments [ 0 ] ; if ( attrs && ( typeof attrs === 'object' ) ) { // Treat vanilla JS object as an attributes dictionary. if ( ! HTML . isConstructedObject ( attrs ) ) { instance . attrs = attrs ; i ++ ; } else if ( attrs instanceof HTML . Attrs ) { var array = attrs . value ; if ( array . length === 1 ) { instance . attrs = array [ 0 ] ; } else if ( array . length > 1 ) { instance . attrs = array ; } i ++ ; } } // If no children, don't create an array at all, use the prototype's // (frozen, empty) array.  This way we don't create an empty array // every time someone creates a tag without `new` and this constructor // calls itself with no arguments (above). if ( i < arguments . length ) instance . children = SLICE . call ( arguments , i ) ; return instance ; } ; HTMLTag . prototype = new HTML . Tag ; HTMLTag . prototype . constructor = HTMLTag ; HTMLTag . prototype . tagName = tagName ; return HTMLTag ; }
Given "p" create the function `HTML.P`.
Given p create the function HTML . P .