Permalink
Browse files

hlist: support spoon

  • Loading branch information...
1 parent 896a8b1 commit 5f6b16eb0d87d393c66c2a3c58a1a45ff03a8169 @indutny indutny committed Jan 20, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/xjst/helpers/hlist.js
@@ -42,7 +42,7 @@ HashList.prototype.add = function add(id, tag, cases, def) {
var index = branch[0],
body = branch[1];
- index = index.replace(/^\((.*)\)$/, '$1');
+ index = index.toString().replace(/^\((.*)\)$/, '$1');
if (index == index - 0) {
hash.numericMap[index] = body;
} else {
@@ -61,8 +61,9 @@ HashList.prototype.add = function add(id, tag, cases, def) {
return [
'var __i = ', tag, ';',
- 'return (', match, ' || ',
- '__h', id, '.d).call(this)'
+ 'return (', match, ' || ', '__h', id, '.d).call(this',
+ this.options.asyncify ? ', __$callback' : '',
+ ');',
].join('');
};

0 comments on commit 5f6b16e

Please sign in to comment.