Skip to content

Commit

Permalink
Fixed #12, object type pos not defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
HairyRabbit committed Dec 25, 2017
1 parent e2f2b6c commit 0a3381d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js2-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0a3381d

Please sign in to comment.