diff options
| author | Jackson Ray Hamilton | 2019-03-25 20:39:48 -0700 |
|---|---|---|
| committer | Jackson Ray Hamilton | 2019-04-08 22:48:23 -0700 |
| commit | 16669d7c5d5a0dfadf672f8359e431ef81044a23 (patch) | |
| tree | 55d370ebbabd90345a34f081772a5a1ef81e7021 /test | |
| parent | 84b1cfbc2d6b9236913a18ed192798fd530911db (diff) | |
| download | emacs-16669d7c5d5a0dfadf672f8359e431ef81044a23.tar.gz emacs-16669d7c5d5a0dfadf672f8359e431ef81044a23.zip | |
Fix counting of nested self-closing JSXOpeningElements
* lisp/progmodes/js.el (js-jsx--matching-close-tag-pos): Fix bug where
self-closing JSXOpeningElements might be missed if one was nested
within another.
* test/manual/indent/jsx-self-closing.jsx: Add test for bug concerning
self-closing JSXOpeningElement counting.
Diffstat (limited to 'test')
| -rw-r--r-- | test/manual/indent/jsx-self-closing.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/manual/indent/jsx-self-closing.jsx b/test/manual/indent/jsx-self-closing.jsx new file mode 100644 index 00000000000..f8ea7a138ad --- /dev/null +++ b/test/manual/indent/jsx-self-closing.jsx | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | // Local Variables: | ||
| 2 | // indent-tabs-mode: nil | ||
| 3 | // js-indent-level: 2 | ||
| 4 | // End: | ||
| 5 | |||
| 6 | // The following test goes below any comments to avoid including | ||
| 7 | // misindented comments among the erroring lines. | ||
| 8 | |||
| 9 | // Properly parse/indent code with a self-closing tag inside the | ||
| 10 | // attribute of another self-closing tag. | ||
| 11 | <div> | ||
| 12 | <div attr={() => <div attr="" />} /> | ||
| 13 | </div> | ||