File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -692,6 +692,8 @@ and {}-bracketed expressions. Return the parsed child."
692692
693693 ((= tt rjsx-JSX-TEXT)
694694 (rjsx-maybe-message " text node: '%s'" (js2-current-token-string))
695+ (js2-record-text-property (js2-current-token-beg) (js2-current-token-end)
696+ 'syntax-table (standard-syntax-table ))
695697 (make-rjsx-text :value (js2-current-token-string)))
696698
697699 ((= tt js2-ERROR)
Original file line number Diff line number Diff line change 127127 " const C = function() { return <component abc={123}/>;\n };"
128128 :warnings-count 0 )
129129
130+ (ert-deftest rjsx-syntax-table-in-text ()
131+ " Ensure JSX text sequences use the default syntax table."
132+ (ert-with-test-buffer (:name 'rjsx )
133+ (insert " const d = <div>{/* this is a comment */}This is" )
134+ (save-excursion (insert " ' text{ anExpression }</div>;" ))
135+ (setq parse-sexp-lookup-properties t )
136+ (js2-mode--and-parse)
137+ (should (eq (syntax-class (syntax-after (point ))) (syntax-class (string-to-syntax " ." ))))))
138+
130139; ;; Now we test all of the malformed bits:
131140
132141(defun jsx-test--forms (forms )
You can’t perform that action at this time.
0 commit comments