[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4d35da5 30/49: Fix the fix (error detection)
From: |
Dmitry Gutov |
Subject: |
[elpa] master 4d35da5 30/49: Fix the fix (error detection) |
Date: |
Mon, 16 Jan 2017 15:35:48 +0000 (UTC) |
branch: master
commit 4d35da5e06f2d0f21ba6022ff9d753748dcb22f3
Author: Mihai Bazon <address@hidden>
Commit: Mihai Bazon <address@hidden>
Fix the fix (error detection)
My previous patch breaks error detection when
js2-recover-from-parse-errors is T. This fixes it, sorry about that.
---
js2-mode.el | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 8fdfb0e..12a5c6a 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -2094,13 +2094,13 @@ Returns nil if element is not found in the list."
"Signal a syntax error or record a parse error."
(if js2-recover-from-parse-errors
(js2-record-parse-error msg msg-arg pos len)
- (signal 'js2-syntax-error
- (list msg
- js2-ts-lineno
- (save-excursion
- (goto-char js2-ts-cursor)
- (current-column))
- js2-ts-hit-eof))))
+ (signal 'js2-syntax-error
+ (list msg
+ js2-ts-lineno
+ (save-excursion
+ (goto-char js2-ts-cursor)
+ (current-column))
+ js2-ts-hit-eof))))
(defun js2-report-warning (msg &optional msg-arg pos len face)
(if js2-compiler-report-warning-as-error
@@ -8655,18 +8655,18 @@ imports or a namespace import that follows it.
The current token must be js2-MUL."
(let ((beg (js2-current-token-beg)))
(cond
- ((and (js2-match-contextual-kwd "as")
- (js2-must-match-prop-name "msg.syntax"))
- (let ((node (make-js2-namespace-import-node
- :pos beg
- :len (- (js2-current-token-end) beg)
- :name (make-js2-name-node
- :pos (js2-current-token-beg)
- :len (- (js2-current-token-end)
- (js2-current-token-beg))
- :name (js2-current-token-string)))))
- (js2-node-add-children node (js2-namespace-import-node-name node))
- node))
+ ((js2-match-contextual-kwd "as")
+ (when (js2-must-match-prop-name "msg.syntax")
+ (let ((node (make-js2-namespace-import-node
+ :pos beg
+ :len (- (js2-current-token-end) beg)
+ :name (make-js2-name-node
+ :pos (js2-current-token-beg)
+ :len (- (js2-current-token-end)
+ (js2-current-token-beg))
+ :name (js2-current-token-string)))))
+ (js2-node-add-children node (js2-namespace-import-node-name node))
+ node)))
(t
(js2-unget-token)
(js2-report-error "msg.syntax")))))
- [elpa] master 64ec0a2 14/49: Allow newline in globals declaration, (continued)
- [elpa] master 64ec0a2 14/49: Allow newline in globals declaration, Dmitry Gutov, 2017/01/16
- [elpa] master 2801681 26/49: Fix "pos" argument in template node constructors, Dmitry Gutov, 2017/01/16
- [elpa] master 712dfb0 29/49: Merge pull request #384 from mishoo/master, Dmitry Gutov, 2017/01/16
- [elpa] master df06798 23/49: Merge pull request #378 from JulianKniephoff/include-externs-locally, Dmitry Gutov, 2017/01/16
- [elpa] master 2a79649 33/49: Fix indentation after regexp in js2-old-indent.el, Dmitry Gutov, 2017/01/16
- [elpa] master f450de0 34/49: Handle destructuring assignments when classifying variables, Dmitry Gutov, 2017/01/16
- [elpa] master 90e37cd 45/49: Merge pull request #397 from lelit/issue393, Dmitry Gutov, 2017/01/16
- [elpa] master 9b63a13 16/49: Special methods should allow keywords as names, Dmitry Gutov, 2017/01/16
- [elpa] master 672e2da 07/49: js2-parse-mul-expr: Parse the right operand as exponentiation too, Dmitry Gutov, 2017/01/16
- [elpa] master a91e357 40/49: Create a separate scope for switch statements, Dmitry Gutov, 2017/01/16
- [elpa] master 4d35da5 30/49: Fix the fix (error detection),
Dmitry Gutov <=
- [elpa] master 31a2399 44/49: Mostly cosmetic, split js2--classify-variables in three simpler functions, Dmitry Gutov, 2017/01/16
- [elpa] master 3725fcf 35/49: Handle other cases of destructuring assignments/initializations, Dmitry Gutov, 2017/01/16
- [elpa] master dad7d09 32/49: feat: add js2-comments-between func, Dmitry Gutov, 2017/01/16
- [elpa] master 523b3cb 38/49: Add a STRICT parameter to js2--collect-declared-symbols, Dmitry Gutov, 2017/01/16
- [elpa] master 1f12517 10/49: Merge pull request #353 from kaushalmodi/js2-jsx-mode-docstring-fix, Dmitry Gutov, 2017/01/16
- [elpa] master 454b242 20/49: Update NEWS.md, Dmitry Gutov, 2017/01/16
- [elpa] master 2d0dc5e 43/49: Cosmetic, reformat to stay within the preferred 80 columns limit, Dmitry Gutov, 2017/01/16
- [elpa] master ff072bf 49/49: Merge commit '03c679eb9914d58d7d9b7afc2036c482a9a01236' from js2-mode, Dmitry Gutov, 2017/01/16
- [elpa] master fbe58dc 18/49: Compute externs on demand, Dmitry Gutov, 2017/01/16
- [elpa] master d3dd406 46/49: fix: copyright year of tests/comsume.el, Dmitry Gutov, 2017/01/16