[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 88d7565 11/33: Respect strict mode.
From: |
Dmitry Gutov |
Subject: |
[elpa] master 88d7565 11/33: Respect strict mode. |
Date: |
Sun, 12 Jul 2015 22:35:37 +0000 |
branch: master
commit 88d75654b22a10e061b1d7e13642ac74dba58b46
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Respect strict mode.
---
js2-mode.el | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 5804480..e4b0ed4 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9431,7 +9431,9 @@ If NODE is non-nil, it is the AST node associated with
the symbol."
(t "msg.parm.redecl"))
name pos len))
((or (= decl-type js2-LET)
- (= decl-type js2-CONST))
+ ;; strict mode const is scoped to the current LexicalEnvironment
+ (and js2-compiler-strict-mode
+ (= decl-type js2-CONST)))
(if (and (= decl-type js2-LET)
(not ignore-not-in-block)
(or (= (js2-node-type js2-current-scope) js2-IF)
@@ -9439,7 +9441,10 @@ If NODE is non-nil, it is the AST node associated with
the symbol."
(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-FUNCTION))
+ (= decl-type js2-FUNCTION)
+ ;; sloppy mode const is scoped to the current VariableEnvironment
+ (and (not js2-compiler-strict-mode)
+ (= decl-type js2-CONST)))
(if symbol
(if (and js2-strict-var-redeclaration-warning (= sdt js2-VAR))
(js2-add-strict-warning "msg.var.redecl" name)
- [elpa] master updated (af721ab -> 2763c9a), Dmitry Gutov, 2015/07/12
- [elpa] master 6d4aa28 03/33: Don't unset `js2-recorded-identifiers', Dmitry Gutov, 2015/07/12
- [elpa] master 709ff60 05/33: Add a NEWS entry for d4d9c54, Dmitry Gutov, 2015/07/12
- [elpa] master a632b02 04/33: Merge pull request #232 from jacksonrayhamilton/unset-identifiers, Dmitry Gutov, 2015/07/12
- [elpa] master d6e6cd6 06/33: Fix object keys highlighting (closes #234), Dmitry Gutov, 2015/07/12
- [elpa] master 422be2d 08/33: Add NEWS entry, Dmitry Gutov, 2015/07/12
- [elpa] master c13eda4 01/33: Generalize object literal parsing to support short-hand function/generator/getter/setter declarations with all kinds of keys (string, named, computed, numeric)., Dmitry Gutov, 2015/07/12
- [elpa] master 09a86b2 09/33: js2-node-externs: Add querystring, Dmitry Gutov, 2015/07/12
- [elpa] master 7c423dd 10/33: Define const variables in the current block., Dmitry Gutov, 2015/07/12
- [elpa] master d39764f 02/33: Merge pull request #231 from shicks/computed, Dmitry Gutov, 2015/07/12
- [elpa] master 88d7565 11/33: Respect strict mode.,
Dmitry Gutov <=
- [elpa] master a5b586f 13/33: Test const scoping., Dmitry Gutov, 2015/07/12
- [elpa] master 254c78c 07/33: Highlight unused and/or uninitialized variables, Dmitry Gutov, 2015/07/12
- [elpa] master 1277c7d 12/33: Track script and function strict mode., Dmitry Gutov, 2015/07/12
- [elpa] master 498bcca 21/33: Fix refactoring regression., Dmitry Gutov, 2015/07/12
- [elpa] master 663efb1 24/33: Remove strict mode slots on nodes., Dmitry Gutov, 2015/07/12
- [elpa] master 6255edb 18/33: Cleanup, Dmitry Gutov, 2015/07/12
- [elpa] master ad4c5cc 20/33: Report the correct octal number error, Dmitry Gutov, 2015/07/12
- [elpa] master ac205a4 16/33: Octal syntax is an error in strict mode, Dmitry Gutov, 2015/07/12
- [elpa] master 7850d12 25/33: Cleanup, Dmitry Gutov, 2015/07/12
- [elpa] master e6cb7bf 15/33: with statements are syntax errors in strict mode, Dmitry Gutov, 2015/07/12