]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix #89
authorDmitry Gutov <dgutov@yandex.ru>
Thu, 7 Mar 2013 02:15:18 +0000 (06:15 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Thu, 7 Mar 2013 02:15:18 +0000 (06:15 +0400)
js2-mode.el
tests/indent.el

index d48505c80321bcaf9ea71f1e06fd47f1fbd86574..c8d56a3aeebdf869174bb108556ba2d2df681916 100644 (file)
@@ -7,7 +7,7 @@
 ;;         Dmitry Gutov <dgutov@yandex.ru>
 ;; URL:  https://github.com/mooz/js2-mode/
 ;;       http://code.google.com/p/js2-mode/
-;; Version: 20130228
+;; Version: 20130307
 ;; Keywords: languages, javascript
 ;; Package-Requires: ((emacs "24.1"))
 
@@ -9594,7 +9594,7 @@ to a multiline declaration statement.  See `js2-pretty-multiline-declarations'."
                         (or (eq (char-before) ?,)
                             (and (not (eq (char-before) ?\;))
                                  (and
-                                  (prog2 (skip-chars-backward "[[:punct:]]")
+                                  (prog2 (skip-syntax-backward ".")
                                       (looking-at js2-indent-operator-re)
                                     (js2-backward-sws))
                                   (not (eq (char-before) ?\;))))
index f09734e288ea1f9c245848485a2d36bfe5339246..d363374778cb1477413acab240cc36e17ba80962 100644 (file)
@@ -7,7 +7,8 @@
       (insert (replace-regexp-in-string "^ *" "" s))
       (js2-mode)
       (indent-region (point-min) (point-max))
-      (should (string= s (buffer-substring (point-min) (point)))))))
+      (should (string= s (buffer-substring-no-properties
+                          (point-min) (point)))))))
 
 (defmacro* js2-deftest-indent (name content &key bind)
   `(ert-deftest ,name ()
   "var foo = 100500 /
   |      16;")
 
+(js2-deftest-indent no-multiline-decl-with-operator-inside-string
+  "var foo = bar('/protocols/')
+  |baz()")
+
 (js2-deftest-indent no-multiline-decl-implicit-semicolon
   "var foo = 100500
   |1")