Don't allow JSXNamespacedName to chain (#10366)
Eg, `namespace:foo.bar` used to parse but is invalid in the [spec](https://facebook.github.io/jsx/). Also, allow `JSXNamespacedName` in the `JSXOpeningElement`/`JSXClosingElement` builders.
This commit is contained in:
@@ -250,10 +250,16 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
// Parses element name in any form - namespaced, member
|
||||
// or single identifier.
|
||||
|
||||
jsxParseElementName(): N.JSXNamespacedName | N.JSXMemberExpression {
|
||||
jsxParseElementName():
|
||||
| N.JSXIdentifier
|
||||
| N.JSXNamespacedName
|
||||
| N.JSXMemberExpression {
|
||||
const startPos = this.state.start;
|
||||
const startLoc = this.state.startLoc;
|
||||
let node = this.jsxParseNamespacedName();
|
||||
if (node.type === "JSXNamespacedName") {
|
||||
return node;
|
||||
}
|
||||
while (this.eat(tt.dot)) {
|
||||
const newNode = this.startNodeAt(startPos, startLoc);
|
||||
newNode.object = node;
|
||||
|
||||
Reference in New Issue
Block a user