Permalink
Browse files

fixes from refectoring

  • Loading branch information...
1 parent 91a484b commit 4bc0b1d25dc5715340e3df9ad96cfc02772131e0 @mckamey committed Nov 24, 2012
Showing with 7 additions and 6 deletions.
  1. +1 −1 jsonml-html.js
  2. +5 −4 jsonml-jbst.js
  3. +1 −1 jsonml-utils.js
View
@@ -50,7 +50,7 @@
return elem;
});
- JsonML.renderHTML(JsonML)
+ JsonML.toHTMLText(JsonML)
Converts JsonML to HTML text
// Implement onerror to handle any runtime errors while binding:
View
@@ -167,14 +167,15 @@ JsonML.BST = (function(){
}
}
+ var appendChild = JsonML.appendChild;
+
/* ctor */
function JBST(/*JsonML*/ jbst) {
if ('undefined' === typeof jbst) {
throw new Error('JBST tree is undefined');
}
- var self = this,
- appendChild = JsonML.appendChild;
+ var self = this;
// recursively applies dataBind to all nodes of the template graph
// NOTE: it is very important to replace each node with a copy,
@@ -314,7 +315,7 @@ JsonML.BST = (function(){
var jml = iterate(jbst, data, index, count, args);
// hydrate the resulting JsonML, executing callbacks, and user-filter
- return JsonML.parse(jml, filter);
+ return JsonML.toHTML(jml, filter);
};
// replaces a DOM element with result from binding
@@ -342,7 +343,7 @@ JsonML.BST = (function(){
var jml = iterate(node, data, index, count, args);
// hydrate the resulting JsonML, executing callbacks, and user-filter
- jml = JsonML.parse(jml, filter);
+ jml = JsonML.toHTML(jml, filter);
if (jml) {
elem.parentNode.replaceChild(jml, elem);
}
View
@@ -177,7 +177,7 @@ var JsonML = JsonML || {};
* @param {array|object|string} child
*/
var appendChild = JsonML.appendChild = function(parent, child) {
- if (!isElement(parent)) {
+ if (!isArray(parent)) {
throw new SyntaxError('invalid JsonML');
}

0 comments on commit 4bc0b1d

Please sign in to comment.