Final fixes for spaces.

Conflicts:
	acorn.js
This commit is contained in:
Ingvar Stepanyan 2014-07-11 00:13:45 +03:00
parent 7560ba4c94
commit daf9e82ab5

View File

@ -544,7 +544,7 @@
tokEnd = tokPos; tokEnd = tokPos;
if (options.locations) tokEndLoc = new Position; if (options.locations) tokEndLoc = new Position;
tokType = type; tokType = type;
if (shouldSkipSpace !== false && !(inXJSTag && val === '>')) { if (shouldSkipSpace !== false && !(inXJSTag && val === '>') && !(inXJSChild && tokType !== _braceL)) {
skipSpace(); skipSpace();
} }
tokVal = val; tokVal = val;
@ -836,7 +836,7 @@
var code = input.charCodeAt(tokPos); var code = input.charCodeAt(tokPos);
// JSX content - either simple text, start of <tag> or {expression} // JSX content - either simple text, start of <tag> or {expression}
if (inXJSChild && code !== 60 && code !== 123) { if (inXJSChild && tokType !== _braceL && code !== 60 && code !== 123 && code !== 125) {
return readXJSText(['<', '{']); return readXJSText(['<', '{']);
} }
@ -3004,16 +3004,13 @@
function parseXJSExpressionContainer() { function parseXJSExpressionContainer() {
var node = startNode(); var node = startNode();
var origInXJSChild = inXJSChild;
var origInXJSTag = inXJSTag; var origInXJSTag = inXJSTag;
inXJSChild = false;
inXJSTag = false; inXJSTag = false;
expect(_braceL); expect(_braceL);
node.expression = tokType === _braceR ? parseXJSEmptyExpression() : parseExpression(); node.expression = tokType === _braceR ? parseXJSEmptyExpression() : parseExpression();
inXJSChild = origInXJSChild;
inXJSTag = origInXJSTag; inXJSTag = origInXJSTag;
expect(_braceR); expect(_braceR);