From 0a3381d7ab0c5dd13a2e2071d2c3d38bd95f7004 Mon Sep 17 00:00:00 2001 From: yuffiy Date: Mon, 25 Dec 2017 19:46:07 +0800 Subject: [PATCH] Fixed #12, object type pos not defined. --- js2-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js2-mode.el b/js2-mode.el index c4b4abcc..d39916b6 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -12497,7 +12497,8 @@ And, if CHECK-ACTIVATION-P is non-nil, use the value of TOKEN." (defun js2-parse-object-type (begin-token &optional decl-p) "Parse object type, e.g. { a: b }" - (let ((end-token (if (and (= begin-token js2-LCB) (not decl-p)) js2-RCB js2-RC))) + (let ((pos (js2-current-token-beg)) + (end-token (if (and (= begin-token js2-LCB) (not decl-p)) js2-RCB js2-RC))) (if (js2-match-token end-token) ; match {} (make-js2-object-type-node :pos pos :len (- (js2-current-token-end) pos)