Skip to content

Commit

Permalink
Merge pull request #80 from pufuwozu/master
Browse files Browse the repository at this point in the history
TypeError when a  moduleName isn't supplied to "generate"
  • Loading branch information
zaach committed Jan 23, 2012
2 parents 5860ef7 + a9fca4a commit 40a0fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jison.js
Expand Up @@ -875,7 +875,7 @@ lrGeneratorMixin.generate = function parser_generate (opt) {
var code = "";

// check for illegal identifier
if (!opt.moduleName.match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) {
if (!opt.moduleName || !opt.moduleName.match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) {
opt.moduleName = "parser";
}
switch (opt.moduleType) {
Expand Down

0 comments on commit 40a0fa8

Please sign in to comment.