Skip to content

Commit

Permalink
Automatically call buildFOO for term of type FOO if available
Browse files Browse the repository at this point in the history
  • Loading branch information
ashb committed Sep 23, 2009
1 parent 0f60d52 commit c80bc84
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,9 @@ Template.Interpreter.prototype = {
},

$get_term: function Template$Interpreter$prototype$$get_term(term) {
if (this["build" + term.type])
return this["build" + term.type](term);

switch (term.type) {

case 'TEXT':
Expand Down Expand Up @@ -2441,8 +2444,6 @@ Template.Interpreter.prototype = {
ret += '}\n';
return ret;

case 'TRY':
return this.buildTRY(term);
case 'THROW':
if (term.names.length && term.args.length > 1) {
if (term.names.length > 1 ) throw new Error("Dont know how to handle this");
Expand All @@ -2455,8 +2456,6 @@ Template.Interpreter.prototype = {
return ret + ")";
}
return "throw " + this.handle_nameargs(term);
case 'CLEAR':
return this.buildCLEAR(term);
default:
throw new Error('Unhandled ' + term.toSource());
}
Expand Down

0 comments on commit c80bc84

Please sign in to comment.