Skip to content

Commit

Permalink
Fix esprima error column number and parsing lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
syg committed May 31, 2012
1 parent e4c369e commit 37aa78d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/esprima.js
Original file line number Diff line number Diff line change
Expand Up @@ -3184,8 +3184,8 @@
var token, id = null, firstRestricted, message, param, paramType, params = [], body, previousStrict, paramSet, paramTypes, returnType;

expectKeyword('function');
returnType = parseInlineableType();
if (!match('(')) {
returnType = parseInlineableType();
token = lookahead();
id = parseVariableIdentifier();
if (strict) {
Expand Down
2 changes: 1 addition & 1 deletion src/ljc.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@

if (e.index) {
// Esprima error, make a loc out of it.
var lc = { line: e.lineNumber, column: e.column };
var lc = { line: e.lineNumber, column: e.column - 1 };
e.loc = { start: lc, end: lc };
logger.error(e.message, { start: lc, end: lc });
logger.flush();
Expand Down

0 comments on commit 37aa78d

Please sign in to comment.