aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-24 14:28:40 +0800
committerGitHub <noreply@github.com>2017-03-24 14:28:40 +0800
commit2e0dc970037b3a22fb367ab77c5fe506317ee40b (patch)
tree881088cc1017036581c6301153bea8159ff8739c /lib
parent701035621d708c39f4bdd2022fc02bdb4a967a39 (diff)
downloadtracifyjs-2e0dc970037b3a22fb367ab77c5fe506317ee40b.tar.gz
tracifyjs-2e0dc970037b3a22fb367ab77c5fe506317ee40b.zip
improve error marker placement (#1644)
For AST_UnaryPrefix, points to the operator rather than end of expression.
Diffstat (limited to 'lib')
-rw-r--r--lib/parse.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/parse.js b/lib/parse.js
index 99d7ce09..1ccde26a 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -1457,7 +1457,7 @@ function parse($TEXT, options) {
function make_unary(ctor, op, expr) {
if ((op == "++" || op == "--") && !is_assignable(expr))
- croak("Invalid use of " + op + " operator");
+ croak("Invalid use of " + op + " operator", null, ctor === AST_UnaryPrefix ? expr.start.col - 1 : null);
return new ctor({ operator: op, expression: expr });
};