Skip to content

Commit

Permalink
Revert "Fix escaped identifier being treated as a keyword."
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Apr 22, 2014
1 parent e901bf7 commit 092b2ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
7 changes: 1 addition & 6 deletions esprima.js
Expand Up @@ -650,12 +650,7 @@ parseStatement: true, parseSourceElement: true */
if (id.length === 1) {
type = Token.Identifier;
} else if (isKeyword(id)) {
// A keyword can not contained escaped characters.
if (index - start === id.length) {
type = Token.Keyword;
} else {
type = Token.Identifier;
}
type = Token.Keyword;
} else if (id === 'null') {
type = Token.NullLiteral;
} else if (id === 'true' || id === 'false') {
Expand Down
7 changes: 0 additions & 7 deletions test/test.js
Expand Up @@ -20281,13 +20281,6 @@ var testFixture = {
message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode'
},

'\\u0066unction a(if) { }': {
index: 14,
lineNumber: 1,
column: 15,
message: 'Error: Line 1: Unexpected identifier'
},

'function t(if) { }': {
index: 11,
lineNumber: 1,
Expand Down

0 comments on commit 092b2ce

Please sign in to comment.