diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-13 12:42:01 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-13 12:42:01 +0300 |
commit | 708abb1ab141c737a70fca9e0af839a0b68d9db0 (patch) | |
tree | f22cd91ad49bcb731a243fc0a374792211ae8733 | |
parent | 370d3e09172c35e4f0a7c6a47edd53625b6e2012 (diff) | |
download | tracifyjs-708abb1ab141c737a70fca9e0af839a0b68d9db0.tar.gz tracifyjs-708abb1ab141c737a70fca9e0af839a0b68d9db0.zip |
minor
-rw-r--r-- | lib/parse.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/parse.js b/lib/parse.js index 662e6dc8..ea9eba50 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1186,28 +1186,30 @@ function parse($TEXT, options) { }); function as_property_name() { - var tmp; - switch (S.token.type) { + var tmp = S.token; + next(); + switch (tmp.type) { case "num": case "string": case "name": case "operator": case "keyword": case "atom": - return (tmp = S.token.value, next(), tmp); + return tmp.value; default: unexpected(); } }; function as_name() { - var tmp; - switch (S.token.type) { + var tmp = S.token; + next(); + switch (tmp.type) { case "name": case "operator": case "keyword": case "atom": - return (tmp = S.token.value, next(), tmp); + return tmp.value; default: unexpected(); } @@ -1263,11 +1265,10 @@ function parse($TEXT, options) { }; var maybe_unary = function(allow_calls) { - var start = S.token, tmp; - if (is("operator") && UNARY_PREFIX(S.token.value)) { - var ex = make_unary(AST_UnaryPrefix, - (tmp = S.token.value, next(), tmp), - maybe_unary(allow_calls)); + var start = S.token; + if (is("operator") && UNARY_PREFIX(start.value)) { + next(); + var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls)); ex.start = start; ex.end = prev(); return ex; |