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;
if (options.locations) tokEndLoc = new Position;
tokType = type;
if (shouldSkipSpace !== false && !(inXJSTag && val === '>')) {
if (shouldSkipSpace !== false && !(inXJSTag && val === '>') && !(inXJSChild && tokType !== _braceL)) {
skipSpace();
}
tokVal = val;
@ -836,7 +836,7 @@
var code = input.charCodeAt(tokPos);
// 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(['<', '{']);
}
@ -3004,16 +3004,13 @@
function parseXJSExpressionContainer() {
var node = startNode();
var origInXJSChild = inXJSChild;
var origInXJSTag = inXJSTag;
inXJSChild = false;
inXJSTag = false;
expect(_braceL);
node.expression = tokType === _braceR ? parseXJSEmptyExpression() : parseExpression();
inXJSChild = origInXJSChild;
inXJSTag = origInXJSTag;
expect(_braceR);