zaach / jison

Bison in JavaScript.
http://jison.org
4.33k stars 448 forks source link

TypeError: undefined is not an object (evaluating 'this.yy.parser') #358

Open waitingcheung opened 6 years ago

waitingcheung commented 6 years ago

I am using handlebars.js, which uses the lexer of jison in the source code. I found out that an invalid template can crash the library at the lexer generated by jison.

The following JSFiddle reproduces the error.

To fix the bug, you may change the if condition if (this.yy.parser) at line 1988 of handlebars.js to if (this.yy && this.yy.parser).