aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/parse.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/parse.js b/lib/parse.js
index cc80a935..8801b50b 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -254,10 +254,12 @@ function tokenizer($TEXT, filename) {
S.tokpos = S.pos;
};
+ var prev_was_dot = false;
function token(type, value, is_comment) {
S.regex_allowed = ((type == "operator" && !UNARY_POSTFIX(value)) ||
- (type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) ||
+ (!prev_was_dot && type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value)) ||
(type == "punc" && PUNC_BEFORE_EXPRESSION(value)));
+ prev_was_dot = (type == "punc" && value == ".");
var ret = {
type : type,
value : value,