()
| 9395 | } |
| 9396 | |
| 9397 | function parseJSXOpeningElement() { |
| 9398 | var name, attributes = [], selfClosing = false, origInJSXChild, origInJSXTag, marker = markerCreate(); |
| 9399 | |
| 9400 | origInJSXChild = state.inJSXChild; |
| 9401 | origInJSXTag = state.inJSXTag; |
| 9402 | state.inJSXChild = false; |
| 9403 | state.inJSXTag = true; |
| 9404 | |
| 9405 | expect('<'); |
| 9406 | |
| 9407 | name = parseJSXElementName(); |
| 9408 | |
| 9409 | while (index < length && |
| 9410 | lookahead.value !== '/' && |
| 9411 | lookahead.value !== '>') { |
| 9412 | attributes.push(parseJSXAttribute()); |
| 9413 | } |
| 9414 | |
| 9415 | state.inJSXTag = origInJSXTag; |
| 9416 | |
| 9417 | if (lookahead.value === '/') { |
| 9418 | expect('/'); |
| 9419 | // Because advance() (called by lex() called by expect()) expects |
| 9420 | // there to be a valid token after >, it needs to know whether to |
| 9421 | // look for a standard JS token or an JSX text node |
| 9422 | state.inJSXChild = origInJSXChild; |
| 9423 | expect('>'); |
| 9424 | selfClosing = true; |
| 9425 | } else { |
| 9426 | state.inJSXChild = true; |
| 9427 | expect('>'); |
| 9428 | } |
| 9429 | return markerApply(marker, delegate.createJSXOpeningElement(name, attributes, selfClosing)); |
| 9430 | } |
| 9431 | |
| 9432 | function parseJSXElement() { |
| 9433 | var openingElement, closingElement = null, children = [], origInJSXChild, origInJSXTag, marker = markerCreate(); |
no test coverage detected