Skip to content

Commit

Permalink
Merge pull request #58 from HairyRabbit/fix-57
Browse files Browse the repository at this point in the history
Closes #57
Closes #37
  • Loading branch information
HairyRabbit authored Feb 7, 2018
2 parents 1647c18 + f005e38 commit 6fe517a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js2-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -9837,6 +9837,7 @@ js2-export-binding-node and consume all the tokens. If it does not match, it
consumes no tokens."
(let ((kind (when import-p (js2-parse-module-kind)))
(extern-name (cond
((js2-match-token js2-DEFAULT) "default")
((js2-match-token js2-TYPEOF) "typeof")
((js2-match-contextual-kwd "type") "type")
((js2-match-prop-name) (js2-current-token-string))
Expand Down Expand Up @@ -9879,6 +9880,10 @@ consumes no tokens."
(if import-p
(js2-set-face (js2-current-token-beg) (js2-current-token-end)
'font-lock-variable-name-face 'record))
;; export { A as B }
;; ---------^ set font face to nil
(js2-set-face beg (+ beg extern-name-len)
'nil 'record)
node)
(js2-unget-token)
nil))
Expand Down
3 changes: 3 additions & 0 deletions tests/flow.el
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,9 @@ case b:
(js2-deftest-parse jsx-2
"() => { <b></b>;\n};")

(js2-deftest-parse export-default-as-named
"export {default as foo} from 'm';")

;;; Babylon plugins and Stage-0

(js2-deftest-parse dynamic-import
Expand Down

0 comments on commit 6fe517a

Please sign in to comment.