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

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

[elpa] master e5e4fa4 105/110: Add js2-mode-assume-strict custom variabl


From: Dmitry Gutov
Subject: [elpa] master e5e4fa4 105/110: Add js2-mode-assume-strict custom variable
Date: Thu, 23 Jun 2016 01:13:04 +0000 (UTC)

branch: master
commit e5e4fa4120a35e2688655eb9346670ef25281cb1
Author: Stephen Hicks <address@hidden>
Commit: Stephen Hicks <address@hidden>

    Add js2-mode-assume-strict custom variable
    
    This allows all files to be parsed as if 'use strict' were on top of
    every file, for the case of JS passed through compilers that assume
    strict input.
    
    Closes #341.
---
 js2-mode.el |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/js2-mode.el b/js2-mode.el
index 4d9bbf8..a46423e 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -277,6 +277,11 @@ end of the line, otherwise, at the beginning of the next 
line."
   :type 'boolean
   :group 'js2-mode)
 
+(defcustom js2-mode-assume-strict nil
+  "Non-nil to start files in strict mode automatically."
+  :type 'boolean
+  :group 'js2-mode)
+
 (defcustom js2-mode-show-strict-warnings t
   "Non-nil to emit Ecma strict-mode warnings.
 Some of the warnings can be individually disabled by other flags,
@@ -7988,7 +7993,7 @@ Scanner should be initialized."
           js2-nesting-of-function 0
           js2-labeled-stmt nil
           js2-recorded-identifiers nil  ; for js2-highlight
-          js2-in-use-strict-directive nil)
+          js2-in-use-strict-directive js2-mode-assume-strict)
     (while (/= (setq tt (js2-get-token)) js2-EOF)
       (if (= tt js2-FUNCTION)
           (progn



reply via email to

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