Add extra.raw back to JSXText and JSXAttribute (#344)

This commit is contained in:
Alex Rattray
2017-04-04 06:47:59 -07:00
committed by Daniel Tschinder
parent 14b7f50e51
commit cbf4203237
20 changed files with 259 additions and 37 deletions

View File

@@ -247,9 +247,7 @@ pp.jsxParseAttributeValue = function() {
case tt.jsxTagStart:
case tt.string:
node = this.parseExprAtom();
node.extra = null;
return node;
return this.parseExprAtom();
default:
this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
@@ -401,10 +399,7 @@ export default function(instance) {
instance.extend("parseExprAtom", function(inner) {
return function(refShortHandDefaultPos) {
if (this.match(tt.jsxText)) {
const node = this.parseLiteral(this.state.value, "JSXText");
// https://github.com/babel/babel/issues/2078
node.extra = null;
return node;
return this.parseLiteral(this.state.value, "JSXText");
} else if (this.match(tt.jsxTagStart)) {
return this.jsxParseElement();
} else {