From daf9e82ab5113018c1f5b9512e15096387cc047c Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Fri, 11 Jul 2014 00:13:45 +0300 Subject: [PATCH] Final fixes for spaces. Conflicts: acorn.js --- acorn.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/acorn.js b/acorn.js index 365dea3ac1..2c5005fbe6 100644 --- a/acorn.js +++ b/acorn.js @@ -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 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);