emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 7c423dd 10/33: Define const variables in the current block


From: Dmitry Gutov
Subject: [elpa] master 7c423dd 10/33: Define const variables in the current block.
Date: Sun, 12 Jul 2015 22:35:37 +0000

branch: master
commit 7c423dd5ebcb5f2e89377feed463c2f26360dbdf
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Define const variables in the current block.
---
 js2-mode.el |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/js2-mode.el b/js2-mode.el
index fbbfeef..5804480 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9430,14 +9430,15 @@ If NODE is non-nil, it is the AST node associated with 
the symbol."
         ((= sdt js2-FUNCTION) "msg.function.redecl")
         (t "msg.parm.redecl"))
        name pos len))
-     ((= decl-type js2-LET)
-      (if (and (not ignore-not-in-block)
+     ((or (= decl-type js2-LET)
+          (= decl-type js2-CONST))
+      (if (and (= decl-type js2-LET)
+               (not ignore-not-in-block)
                (or (= (js2-node-type js2-current-scope) js2-IF)
                    (js2-loop-node-p js2-current-scope)))
           (js2-report-error "msg.let.decl.not.in.block")
         (js2-define-new-symbol decl-type name node)))
      ((or (= decl-type js2-VAR)
-          (= decl-type js2-CONST)
           (= decl-type js2-FUNCTION))
       (if symbol
           (if (and js2-strict-var-redeclaration-warning (= sdt js2-VAR))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]