From c152be4a2e8383a21c573ba0b2495afc9ae84643 Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke
Date: Wed, 28 Aug 2013 16:22:30 +0200
Subject: [PATCH] Improve error message for ++/re/
Closes #54
---
acorn.js | 1 +
index.html | 1 +
2 files changed, 2 insertions(+)
diff --git a/acorn.js b/acorn.js
index 4d5b23e578..ade6e3f92b 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1476,6 +1476,7 @@
var node = startNode(), update = tokType.isUpdate;
node.operator = tokVal;
node.prefix = true;
+ tokRegexpAllowed = true;
next();
node.argument = parseMaybeUnary();
if (update) checkLVal(node.argument);
diff --git a/index.html b/index.html
index 968745e008..4099e39ffa 100644
--- a/index.html
+++ b/index.html
@@ -1082,6 +1082,7 @@ operator that has a lower precedence than the set it is parsing.
var node = startNode(), update = tokType.isUpdate;
node.operator = tokVal;
node.prefix = true;
+ tokRegexpAllowed = true;
next();
node.argument = parseMaybeUnary();
if (update) checkLVal(node.argument);