imperative implementation: Polymer() specify an 'own' prototype for tag `name`
554659
function element(name, prototype) {
    if (typeof name !== 'string') {
      var script = prototype || document._currentScript;
      prototype = name;
      name = script && script.parentNode && script.parentNode.getAttribute ?
          script.parentNode.getAttribute('name') : '';
      if (!name) {
        throw 'Element name could not be inferred.';
      }
    }
    if (getRegisteredPrototype(name)) {
      throw 'Already registered (Polymer) prototype for element ' + name;
    }
    // cache the prototype
    registerPrototype(name, prototype);
    // notify the registrar waiting for 'name', if any
    notifyPrototype(name);
  }
1010272
function () {
        "use strict";
    
        var events = new Events({'bind': this});
    
        var ready;
        Object.defineProperty(this, 'ready', {
            'get': function () {
                return ready;
            }
        });
    
        var controls = [];
        Object.defineProperty(this, 'list', {
            'get': function () {
                return controls;
            }
        });
    
        this.register = function (register) {
    
            for (var name in register) {
    
                var specs = register[name];
                if (typeof specs === 'string') {
                    specs = {'path': specs};
                }
    
                controls[name] = new Control(name, specs);
    
            }
    
        };
    
        function importControls(controlsToImport, callback) {
    
            var coordinate = new Coordinate(controlsToImport, callback);
    
            for (var i in controlsToImport) {
    
                (function (control) {
    
                    control = controls[control];
                    if (!control) {
                        console.error('Control "' + controlsToImport[i] + '" is not registered.');
                        return;
                    }
    
                    control.load(coordinate[control.name]);
    
                })(controlsToImport[i]);
    
            }
    
        }
    
        this.import = function (controlsToImport, callback) {
    
            if (!ready) {
                this.done(Delegate(importControls, controlsToImport, callback));
                return;
            }
    
            importControls(controlsToImport, callback);
    
        };
    
        var callbacks = [];
        this.done = function (callback) {
    
            if (ready) {
                callback();
                return;
            }
    
            callbacks.push(callback);
    
        };
    
        // Polymer is ready when beyond is ready
        beyond.done(function () {
    
            ready = true;
            events.trigger('ready');
    
            for (var i in callbacks) {
                callbacks[i]();
            }
    
            callbacks = [];
    
        });
    
    }
668495
function (node, name, value) {
    var propertyInfo = DOMProperty_1.getPropertyInfo(name);

    if (propertyInfo && DOMProperty_1.shouldSetAttribute(name, value)) {
      var mutationMethod = propertyInfo.mutationMethod;
      if (mutationMethod) {
        mutationMethod(node, value);
      } else if (shouldIgnoreValue(propertyInfo, value)) {
        DOMPropertyOperations.deleteValueForProperty(node, name);
        return;
      } else if (propertyInfo.mustUseProperty) {
        // Contrary to `setAttribute`, object properties are properly
        // `toString`ed by IE8/9.
        node[propertyInfo.propertyName] = value;
      } else {
        var attributeName = propertyInfo.attributeName;
        var namespace = propertyInfo.attributeNamespace;
        // `setAttribute` with objects becomes only `[object]` in IE8/9,
        // ('' + value) makes it output the correct toString()-value.
        if (namespace) {
          node.setAttributeNS(namespace, attributeName, '' + value);
        } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
          node.setAttribute(attributeName, '');
        } else {
          node.setAttribute(attributeName, '' + value);
        }
      }
    } else {
      DOMPropertyOperations.setValueForAttribute(node, name, DOMProperty_1.shouldSetAttribute(name, value) ? value : null);
      return;
    }

    {
      var payload = {};
      payload[name] = value;
      ReactInstrumentation.debugTool.onHostOperation({
        instanceID: ReactDOMComponentTree_1.getInstanceFromNode(node)._debugID,
        type: 'update attribute',
        payload: payload
      });
    }
  }
473178
function compile(fragments, template) {
  var walker = document.createTreeWalker(template, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
  var bindings = [], currentNode, parentNode, previousNode;

  // Reset first node to ensure it isn't a fragment
  walker.nextNode();
  walker.previousNode();

  // find bindings for each node
  do {
    currentNode = walker.currentNode;
    parentNode = currentNode.parentNode;
    bindings.push.apply(bindings, getBindingsForNode(fragments, currentNode, template));

    if (currentNode.parentNode !== parentNode) {
      // currentNode was removed and made a template
      walker.currentNode = previousNode || walker.root;
    } else {
      previousNode = currentNode;
    }
  } while (walker.nextNode());

  return bindings;
}
655760
function (p, def) {
                // The prototype should be an instance of Template, that inheriths from BaseTemplate
                p.$BaseTemplate.constructor.classDefinition.$prototype.$init(p, def);

                // copy the prototype of ITemplate:
                var itf = ITemplate.prototype;
                for (var key in itf) {
                    if (itf.hasOwnProperty(key) && !p.hasOwnProperty(key)) {
                        // copy methods which are not already on this object (this avoids copying $classpath and
                        // $destructor)
                        p[key] = itf[key];
                    }
                }

                // get shortcuts to necessary functions in other classes,
                // so that templates work even in a sandbox
                p.$json = require('../utils/Json');
            }
927469
function elementCreate(name, overriddenRenderer) {
    var native;
    var rendererToUse = overriddenRenderer || renderer;
    if (isProceduralRenderer(rendererToUse)) {
        native = rendererToUse.createElement(name, _currentNamespace);
    }
    else {
        if (_currentNamespace === null) {
            native = rendererToUse.createElement(name);
        }
        else {
            native = rendererToUse.createElementNS(_currentNamespace, name);
        }
    }
    return native;
}
929322
function getElementName (props, tag) {
  if (typeof props.id === 'string' && !placeholderRe.test(props.id)) {
    return camelCase(props.id)
  }
  if (typeof props.className === 'string' && !placeholderRe.test(props.className)) {
    return camelCase(props.className.split(' ')[0])
  }
  return tag || 'nanohtml'
}
588871
function Element(doc, name, content) {
    if (!doc) {
        throw new Error('document argument required');
    } else if (! (doc instanceof bindings.Document)) {
        throw new Error('document argument must be an ' +
                        'instance of Document');
    } else if (!name) {
        throw new Error('name argument required');
    }

    return new bindings.Element(doc, name, content);
}
374174
function (node, name) {
    var propertyInfo = DOMProperty_1.getPropertyInfo(name);
    if (propertyInfo) {
      var mutationMethod = propertyInfo.mutationMethod;
      if (mutationMethod) {
        mutationMethod(node, undefined);
      } else if (propertyInfo.mustUseProperty) {
        var propName = propertyInfo.propertyName;
        if (propertyInfo.hasBooleanValue) {
          node[propName] = false;
        } else {
          node[propName] = '';
        }
      } else {
        node.removeAttribute(propertyInfo.attributeName);
      }
    } else {
      node.removeAttribute(name);
    }

    {
      ReactInstrumentation.debugTool.onHostOperation({
        instanceID: ReactDOMComponentTree_1.getInstanceFromNode(node)._debugID,
        type: 'remove attribute',
        payload: name
      });
    }
  }
266248
function(name, extendee) { 
      var info = {
        prototype: this.prototype
      }
      // native element must be specified in extends
      var typeExtension = this.findTypeExtension(extendee);
      if (typeExtension) {
        info.extends = typeExtension;
      }
      // register the prototype with HTMLElement for name lookup
      HTMLElement.register(name, this.prototype);
      // register the custom type
      this.ctor = document.registerElement(name, info);
    }
1255067
function tag(name, attrs, close, content) {
  var end = close ? '/>' : '>';
  var pairs = [];
  var tag;

  for (var key in attrs) {
    if (Object.prototype.hasOwnProperty.call(attrs, key)) {
      pairs.push(key + '="' + escape(attrs[key]) + '"');
    }
  }

  tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
  if (content) {
    tag += content + '</' + name + end;
  }
  return tag;
}
1137192
private PolyfillInfo createPolyfillInfo(Node call, Scope scope, String name) {
    checkState(scope.isGlobal());
    checkState(call.getParent().isExprResult());
    // Make the removable and polyfill info.  Add continuations for all arguments.
    RemovableBuilder builder = new RemovableBuilder();
    for (Node n = call.getFirstChild().getNext(); n != null; n = n.getNext()) {
      builder.addContinuation(new Continuation(n, scope));
    }
    Polyfill removable = builder.buildPolyfill(call.getParent());
    int lastDot = name.lastIndexOf(".");
    if (lastDot < 0) {
      return new GlobalPolyfillInfo(removable, name);
    }
    String owner = name.substring(0, lastDot);
    String prop = name.substring(lastDot + 1);
    boolean typed = call.getJSType() != null;
    if (owner.endsWith(DOT_PROTOTYPE)) {
      owner = owner.substring(0, owner.length() - DOT_PROTOTYPE.length());
      return new PrototypePropertyPolyfillInfo(
          removable, prop, typed ? compiler.getTypeRegistry().getType(scope, owner) : null);
    }
    ObjectType ownerInstanceType =
        typed ? ObjectType.cast(compiler.getTypeRegistry().getType(scope, owner)) : null;
    JSType ownerCtorType = ownerInstanceType != null ? ownerInstanceType.getConstructor() : null;
    return new StaticPropertyPolyfillInfo(removable, prop, ownerCtorType, owner);
  }
1073977
function taggedAs(taggedItem, name, namespace, namespaceEx) {
  var tags = taggedItem.tags || taggedItem.Tags;

  if (!namespace)                                           { return /* undefined */; }
  if (!tags)                                                { return /* undefined */; }

  // The new, improved way (item.namespace=foo && item[name]=value)
  if (tags.namespace === namespace) {
    if (name in tags)                                       { return tags[name]; }
  }

  if (tags[namespace]   && (name in tags[namespace]))       { return tags[namespace][name]; }

  if (!namespaceEx)                                         { return /* undefined */; }
  if (tags[namespaceEx] && (name in tags[namespaceEx]))     { return tags[namespaceEx][name]; }

  return /* undefined */;
}
804565
function Control(module) {
        "use strict";
    
        var id;
        Object.defineProperty(this, 'id', {
            'get': function () {
                return id;
            },
            'set': function (value) {
                if (id) {
                    throw new Error('Attribute "id" is read only');
                }
                id = value;
            }
        });
    
        var defined;
        this.define = function (specs) {
            "use strict";
    
            if (!id) {
                throw new Error('Control id was not specified, check the module.json file');
            }
            if (typeof specs !== 'object') {
                throw new Error('Invalid parameters');
            }
    
            if (defined) {
                throw new Error('Control already defined');
            }
            defined = true;
    
            var behavior = new Behavior(module, specs);
            Polymer({'is': id, 'behaviors': [behavior]});
    
        };
    
    }
685866
function(schema, raw_template, callback_name) {

		var result = [],
			tags = Lava.parsers.Common.asBlockType(raw_template, 'tag'),
			i = 0,
			count = tags.length;

		for (; i < count; i++) {

			if (Lava.schema.DEBUG && tags[i].name != schema.tag_name) Lava.t("Unknown tag in collection: " + tags[i].name);
			result.push(
				this[callback_name](schema, tags[i])
			);

		}

		return result;

	}
26750
function makeElement(tagName, attributes) {
    var el = fabric.document.createElement(tagName);
    for (var prop in attributes) {
      if (prop === 'class') {
        el.className = attributes[prop];
      }
      else if (prop === 'for') {
        el.htmlFor = attributes[prop];
      }
      else {
        el.setAttribute(prop, attributes[prop]);
      }
    }
    return el;
  }
1317585
function modifyPrototype(prototype, names, callback) {
    trimAll(names).split(',').forEach(name => {
        prototype[name] = function () {
            utils[name](this, callback);
        };
    });
}