Skip to content

Commit

Permalink
esprima.js: do locale mapping before length checks
Browse files Browse the repository at this point in the history
  • Loading branch information
kig committed Aug 2, 2012
1 parent e025763 commit d1f3ea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esprima.js
Expand Up @@ -487,6 +487,8 @@ parseStatement: true, parseSourceElement: true */
}
}

id = LocaleMappings[locale][id] || id;

// There is no keyword or literal with only one character.
// Thus, it must be an identifier.
if (id.length === 1) {
Expand All @@ -499,8 +501,6 @@ parseStatement: true, parseSourceElement: true */
};
}

id = LocaleMappings[locale][id] || id;

if (isKeyword(id)) {
return {
type: Token.Keyword,
Expand Down

0 comments on commit d1f3ea3

Please sign in to comment.