[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/js2-mode 997d6bd 30/61: Avoid undefined behavior in ind
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/js2-mode 997d6bd 30/61: Avoid undefined behavior in indentation tests. |
Date: |
Sun, 20 Dec 2020 12:20:04 -0500 (EST) |
branch: externals/js2-mode
commit 997d6bd13565acd8710b6382d65d5ffb31e4f003
Author: Philipp Stephani <phst@google.com>
Commit: Philipp Stephani <phst@google.com>
Avoid undefined behavior in indentation tests.
Info node ‘(elisp) Local Variables’ states:
> […] the order of _bindings_ is unspecified: […] Therefore, avoid binding a
> variable more than once in a single ‘let’ form.
In fact, the tests that bind ‘js2-pretty-multiline-declarations’ twice fail
if
indent.el is byte-compiled.
---
tests/indent.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tests/indent.el b/tests/indent.el
index 0924691..57db7cf 100644
--- a/tests/indent.el
+++ b/tests/indent.el
@@ -39,11 +39,14 @@
(cl-defmacro js2-deftest-indent (name content &key bind keep-indent)
`(ert-deftest ,(intern (format "js2-%s" name)) ()
- (let ,(append '(indent-tabs-mode
- (js2-basic-offset 2)
- (js2-pretty-multiline-declarations t)
- (inhibit-point-motion-hooks t))
- bind)
+ ;; We use ‘let*’ instead of ‘let’ in case a binding in BIND overwrites one
+ ;; of the outer bindings. See the note about duplicate bindings in the
+ ;; Info node ‘(elisp) Local Variables’.
+ (let* ,(append '(indent-tabs-mode
+ (js2-basic-offset 2)
+ (js2-pretty-multiline-declarations t)
+ (inhibit-point-motion-hooks t))
+ bind)
(js2-test-indent ,content ,keep-indent))))
(put 'js2-deftest-indent 'lisp-indent-function 'defun)
- [elpa] externals/js2-mode e785721 17/61: Reference latest revision of the commentary, (continued)
- [elpa] externals/js2-mode e785721 17/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode d9bba5b 12/61: Update recommendations for using JSX with respect to Emacs 27, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 6cc0a8a 15/61: Merge paragraphs so the information reads better, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 14113fe 18/61: Remove date, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 8e2cdd4 19/61: Revert extra added information, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode bb73461 20/61: Revert doc changes and explain JSX options for all emacsen later, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 3a80b00 25/61: use type face for class, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 9837d78 28/61: Fix ‘huge-hex’ test for newer Emacsen., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 515d876 27/61: Fix parsing static props without semicolons, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 61a8c91 29/61: Merge pull request #550 from phst/huge-hex, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 997d6bd 30/61: Avoid undefined behavior in indentation tests.,
Dmitry Gutov <=
- [elpa] externals/js2-mode 999c0e7 22/61: Merge pull request #531 from jacksonrayhamilton/jsx-documentation, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 2d2fb4b 21/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 146c1f6 32/61: Migrate off deprecated ‘cl’ library., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode d642b7b 34/61: Remove an unused variable, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 8841175 23/61: support optional-chaining operator, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode b3841a7 24/61: Merge pull request #533 from redguardtoo/master, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 1a5dee9 38/61: Merge pull request #552 from phst/cl, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode a6e1305 41/61: Merge pull request #555 from phst/unused-arg, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 5049e54 43/61: Merge pull request #556 from ArneBab/browser-symbols, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 6b84319 44/61: Remove a few unused variables., Dmitry Gutov, 2020/12/20