[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2469440 26/33: Fix bug where properties where checked for
From: |
Dmitry Gutov |
Subject: |
[elpa] master 2469440 26/33: Fix bug where properties where checked for strict mode compliance |
Date: |
Sun, 12 Jul 2015 22:35:44 +0000 |
branch: master
commit 24694401ec6479a5e59425b010f57b69cf15bafb
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>
Fix bug where properties where checked for strict mode compliance
---
js2-mode.el | 5 ++++-
tests/parser.el | 3 +++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 89e18ab..48a2c77 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9668,7 +9668,10 @@ If NODE is non-nil, it is the AST node associated with
the symbol."
;; tt express assignment (=, |=, ^=, ..., %=)
(setq op-pos (- (js2-current-token-beg) pos) ; relative
left pn)
- (js2-check-strict-identifier left)
+ ;; The assigned node could be a js2-prop-get-node (foo.bar = 0), we
only
+ ;; care about assignment to strict variable names.
+ (when (js2-name-node-p left)
+ (js2-check-strict-identifier left))
(setq right (js2-parse-assign-expr)
pn (make-js2-assign-node :type tt
:pos pos
diff --git a/tests/parser.el b/tests/parser.el
index b9c9c68..bfc5653 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -281,6 +281,9 @@ the test."
"'use strict';\narguments = 'fufufu';"
:syntax-error "arguments" :errors-count 1)
+(js2-deftest-parse function-property-strict-assignment
+ "'use strict';\narguments.okay = 'alright';")
+
(js2-deftest-parse function-strict-with
"'use strict';\nwith ({}) {}"
:syntax-error "with" :errors-count 1)
- [elpa] master 663efb1 24/33: Remove strict mode slots on nodes., (continued)
- [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
- [elpa] master 46e1492 23/33: Reparse strict functions., Dmitry Gutov, 2015/07/12
- [elpa] master 1391f2e 22/33: setq inline, Dmitry Gutov, 2015/07/12
- [elpa] master f1edac7 19/33: Don't treat a block-scoped const as redeclaration, Dmitry Gutov, 2015/07/12
- [elpa] master c588e31 17/33: Duplicate object keys are an error in strict mode, Dmitry Gutov, 2015/07/12
- [elpa] master 2469440 26/33: Fix bug where properties where checked for strict mode compliance,
Dmitry Gutov <=
- [elpa] master 12e5a21 28/33: Remove js2-current-indent, Dmitry Gutov, 2015/07/12
- [elpa] master 5b25da2 30/33: Add NEWS entry and bump version, Dmitry Gutov, 2015/07/12
- [elpa] master e0ecf99 14/33: Check identifiers in strict mode., Dmitry Gutov, 2015/07/12
- [elpa] master f3a899b 32/33: And actually update NEWS, Dmitry Gutov, 2015/07/12
- [elpa] master 53f3f52 31/33: Actually remove the macro, Dmitry Gutov, 2015/07/12
- [elpa] master eb33e68 29/33: Get rid of js2-with-underscore-as-word-syntax, Dmitry Gutov, 2015/07/12
- [elpa] master 5e5df54 27/33: Merge pull request #242 from jacksonrayhamilton/strict-mode, Dmitry Gutov, 2015/07/12
- [elpa] master 2763c9a 33/33: Merge commit 'f3a899bb1c36e25e078eed2890eb2fecb22f4175' from js2-mode, Dmitry Gutov, 2015/07/12