From d72ed2060337e9f4400bcec85f8daaf18cb05413 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 25 Dec 2017 04:33:44 +0200 Subject: [PATCH] Fix the breakage POS could be nil. --- js2-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js2-mode.el b/js2-mode.el index 2fc4855a..53634aa6 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -11092,7 +11092,7 @@ and expression closure style is also supported { get foo() x, set foo(x) _x = x } -POS is the start position of the `get' or `set' keyword. +POS is the start position of the `get' or `set' keyword, if any. PROP is the `js2-name-node' representing the property name. TYPE-STRING is a string `get', `set', `*', or nil, indicating a found keyword." (let* ((type (or (cdr (assoc type-string '(("get" . GET) @@ -11100,6 +11100,7 @@ TYPE-STRING is a string `get', `set', `*', or nil, indicating a found keyword." ("async" . ASYNC)))) 'FUNCTION)) result end + (pos (or pos (js2-current-token-beg))) (_ (js2-must-match js2-LP "msg.no.paren.parms")) (fn (js2-parse-function 'FUNCTION_EXPRESSION pos (string= type-string "*")