Allow tag name to be passed to createNode

This commit is contained in:
Patrick Steele-Idem 2014-07-07 15:26:45 -06:00
parent ec78f78dfc
commit c80b8feda3

View File

@ -216,6 +216,11 @@ TemplateCompiler.prototype = {
},
createNode: function(Ctor, arg) {
if (typeof Ctor === 'string') {
var tagName = Ctor;
Ctor = this.getNodeClass(tagName);
}
ok(Ctor != null, 'Ctor is required');
ok(typeof Ctor === 'function', 'Ctor should be a function');