Skip to content

Commit

Permalink
Provide default argument for var if one is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Jun 30, 2012
1 parent 6667db8 commit cce0b08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ls.js
Expand Up @@ -273,8 +273,8 @@ var handleError = function(no, line, filename) {
};

keywords["var"] = function(arr) {
if (!validName.test(arr[1])) throw handleError(9, arr._line, arr._filename);
return templates["var"]({rest: keywords.set(arr)});
if (arr.length < 2) arr.push("undefined");
return templates["var"]({ rest: keywords.set(arr) });
};

keywords["new"] = function(arr) {
Expand Down

0 comments on commit cce0b08

Please sign in to comment.