diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-23 15:03:20 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-23 15:04:37 -0700 |
commit | 565f0517db482bad310655ac347078d54a15cc8b (patch) | |
tree | 346799f72a5025a132c34af9e37e687df6a621a6 | |
parent | d01e4caa1ebcc44f1d9a13cdcbf4448d824ec26f (diff) |
fix bug with parsing of empty types
-rw-r--r-- | src/intertyper.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 4c35db34..96db6966 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -471,8 +471,8 @@ function intertyper(lines, sidePass, baseLineNums) { item.tokens[1] = item.tokens[1].tokens[0]; } var subTokens = item.tokens[1].tokens; - if (subTokens) { - subTokens.push({text:','}); + if (subTokens && subTokens.length > 0) { + subTokens.push({text:','}); // XXX we should avoid altering tokens like that while (subTokens[0]) { var stop = 1; while ([','].indexOf(subTokens[stop].text) == -1) stop ++; |