From 0a755156a8f3191b6f13be17b5c6ac88dae0cade Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 19 Mar 2015 13:11:17 +0100 Subject: [PATCH] Ignore backslash-escapes in identifiers in ES6 mode --- acorn.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acorn.js b/acorn.js index 3fefa233ba..2fe39a2d90 100644 --- a/acorn.js +++ b/acorn.js @@ -2737,10 +2737,10 @@ if (liberal && this.options.allowReserved == "never") liberal = false; if (this.type === tt.name) { if (!liberal && - (!this.options.allowReserved && - this.isReservedWord(this.value) || - this.strict && isStrictReservedWord(this.value)) && - this.input.slice(this.start, this.end).indexOf("\\") == -1) + ((!this.options.allowReserved && this.isReservedWord(this.value)) || + (this.strict && isStrictReservedWord(this.value)) && + (this.options.ecmaVersion >= 6 || + this.input.slice(this.start, this.end).indexOf("\\") == -1))) this.raise(this.start, "The keyword '" + this.value + "' is reserved"); node.name = this.value; } else if (liberal && this.type.keyword) {