Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Fix: Ensure JSX tag names are JSXIdentifiers (fixes #315) (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
soda0289 authored and JamesHenry committed Jun 9, 2017
1 parent 1f20557 commit 4938c2c
Show file tree
Hide file tree
Showing 3 changed files with 809 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ module.exports = function convert(config) {
tagNameToken.object.type = (isNestedMemberExpression) ? AST_NODE_TYPES.JSXMemberExpression : AST_NODE_TYPES.JSXIdentifier;
tagNameToken.property.type = AST_NODE_TYPES.JSXIdentifier;
} else {
tagNameToken.type = AST_NODE_TYPES.JSXIdentifier;
tagNameToken.name = tagNameToken.value;
}

Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/jsx/element-keyword-name.src.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
<object />
<abstract />
<module />
</div>
Loading

0 comments on commit 4938c2c

Please sign in to comment.