diff --git a/esprima.js b/esprima.js index cdca07fe2..2a190f494 100644 --- a/esprima.js +++ b/esprima.js @@ -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') { diff --git a/test/test.js b/test/test.js index 28092aa39..f26c0aa9a 100644 --- a/test/test.js +++ b/test/test.js @@ -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,