Permalink
Browse files

esprima.js: do locale mapping before length checks

  • Loading branch information...
1 parent e025763 commit d1f3ea33bd8061cfdb576bf5ee0e9b55e8b27793 @kig committed Aug 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 esprima.js
View
4 esprima.js
@@ -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) {
@@ -499,8 +501,6 @@ parseStatement: true, parseSourceElement: true */
};
}
- id = LocaleMappings[locale][id] || id;
-
if (isKeyword(id)) {
return {
type: Token.Keyword,

0 comments on commit d1f3ea3

Please sign in to comment.