diff --git a/test/tests-jsx.js b/test/tests-jsx.js index a65f51b2b8..bd2b7d307f 100644 --- a/test/tests-jsx.js +++ b/test/tests-jsx.js @@ -1,108 +1,99 @@ // React JSX tests -if (typeof exports != "undefined") { +if (typeof exports !== "undefined") { var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; - var testAssert = require("./driver.js").testAssert; } // Simply taken from esprima-fb/fbtest.js var fbTestFixture = { - 'XJS': { - '': { - type: "ExpressionStatement", - expression: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "a", - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - selfClosing: true, - attributes: [], - range: [0, 5], + '': { + type: "ExpressionStatement", + expression: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "a", + range: [1, 2], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - children: [], + selfClosing: true, + attributes: [], range: [0, 5], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, + children: [], range: [0, 5], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 5 } } }, - '': { - type: 'ExpressionStatement', - expression: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + '': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSNamespacedName', + namespace: { + type: 'XJSIdentifier', + name: 'n', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + name: { + type: 'XJSIdentifier', + name: 'a', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, + selfClosing: true, + attributes: [{ + type: 'XJSAttribute', name: { type: 'XJSNamespacedName', namespace: { type: 'XJSIdentifier', name: 'n', - range: [1, 2], + range: [5, 6], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } } }, name: { type: 'XJSIdentifier', - name: 'a', - range: [3, 4], + name: 'v', + range: [7, 8], loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } - } - }, - range: [1, 4], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 4 } - } - }, - selfClosing: true, - attributes: [{ - type: 'XJSAttribute', - name: { - type: 'XJSNamespacedName', - namespace: { - type: 'XJSIdentifier', - name: 'n', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - name: { - type: 'XJSIdentifier', - name: 'v', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, + start: { line: 1, column: 7 }, end: { line: 1, column: 8 } } }, @@ -111,395 +102,385 @@ var fbTestFixture = { start: { line: 1, column: 5 }, end: { line: 1, column: 8 } } - }], - range: [0, 11], + }, + range: [5, 8], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } } - }, - children: [], + }], range: [0, 11], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 11 } } }, + children: [], range: [0, 11], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 11 } } }, - ' {value} ': { - type: 'ExpressionStatement', - expression: { + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + ' {value} ': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + selfClosing: false, + attributes: [{ + type: 'XJSAttribute', + name: { + type: 'XJSNamespacedName', + namespace: { + type: 'XJSIdentifier', + name: 'n', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + name: { + type: 'XJSIdentifier', + name: 'foo', + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + range: [3, 8], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 8 } + } + }, + value: { + type: 'Literal', + value: 'bar', + raw: '"bar"', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + range: [3, 14], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 14 } + } + }], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSIdentifier', + name: 'a', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }, + range: [36, 40], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 40 } + } + }, + children: [{ + type: 'Literal', + value: ' ', + raw: ' ', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'XJSExpressionContainer', + expression: { + type: 'Identifier', + name: 'value', + range: [17, 22], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 22 } + } + }, + range: [16, 23], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 23 } + } + }, { + type: 'Literal', + value: ' ', + raw: ' ', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, { type: 'XJSElement', openingElement: { type: 'XJSOpeningElement', name: { type: 'XJSIdentifier', - name: 'a', - range: [1, 2], + name: 'b', + range: [25, 26], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } } }, selfClosing: false, - attributes: [{ - type: 'XJSAttribute', - name: { - type: 'XJSNamespacedName', - namespace: { - type: 'XJSIdentifier', - name: 'n', - range: [3, 4], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } - } - }, - name: { - type: 'XJSIdentifier', - name: 'foo', - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - range: [3, 8], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 8 } - } - }, - value: { - type: 'Literal', - value: 'bar', - raw: '"bar"', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - range: [3, 14], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 14 } - } - }], - range: [0, 15], + attributes: [], + range: [24, 27], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 24 }, + end: { line: 1, column: 27 } } }, closingElement: { type: 'XJSClosingElement', name: { type: 'XJSIdentifier', - name: 'a', - range: [38, 39], + name: 'b', + range: [34, 35], loc: { - start: { line: 1, column: 38 }, - end: { line: 1, column: 39 } + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } } }, - range: [36, 40], + range: [32, 36], loc: { - start: { line: 1, column: 36 }, - end: { line: 1, column: 40 } + start: { line: 1, column: 32 }, + end: { line: 1, column: 36 } } }, children: [{ - type: 'Literal', - value: ' ', - raw: ' ', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, { - type: 'XJSExpressionContainer', - expression: { - type: 'Identifier', - name: 'value', - range: [17, 22], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 22 } - } - }, - range: [16, 23], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 23 } - } - }, { - type: 'Literal', - value: ' ', - raw: ' ', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, { type: 'XJSElement', openingElement: { type: 'XJSOpeningElement', name: { type: 'XJSIdentifier', - name: 'b', - range: [25, 26], + name: 'c', + range: [28, 29], loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } } }, - selfClosing: false, + selfClosing: true, attributes: [], - range: [24, 27], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 27 } - } - }, - closingElement: { - type: 'XJSClosingElement', - name: { - type: 'XJSIdentifier', - name: 'b', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }, - range: [32, 36], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 36 } - } - }, - children: [{ - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSIdentifier', - name: 'c', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }, - selfClosing: true, - attributes: [], - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, - children: [], range: [27, 32], loc: { start: { line: 1, column: 27 }, end: { line: 1, column: 32 } } - }], - range: [24, 36], + }, + children: [], + range: [27, 32], loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 36 } + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } } }], - range: [0, 40], + range: [24, 36], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 40 } + start: { line: 1, column: 24 }, + end: { line: 1, column: 36 } } - }, + }], range: [0, 40], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 40 } } }, - '': { - type: "ExpressionStatement", - expression: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "a", - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - selfClosing: true, - attributes: [ - { - type: "XJSAttribute", - name: { - type: "XJSIdentifier", - name: "b", - range: [3, 4], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } - } - }, - value: { - type: "XJSExpressionContainer", - expression: { - type: "Literal", - value: " ", - raw: "\" \"", - range: [6, 9], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 9 } - } - }, - range: [5, 10], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } - } - }, - range: [3, 10], + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + } + }, + '': { + type: "ExpressionStatement", + expression: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "a", + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + selfClosing: true, + attributes: [ + { + type: "XJSAttribute", + name: { + type: "XJSIdentifier", + name: "b", + range: [3, 4], loc: { start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } + end: { line: 1, column: 4 } } }, - { - type: "XJSAttribute", - name: { - type: "XJSIdentifier", - name: "c", - range: [11, 12], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } - } - }, - value: { + value: { + type: "XJSExpressionContainer", + expression: { type: "Literal", value: " ", raw: "\" \"", - range: [13, 16], + range: [6, 9], loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 16 } + start: { line: 1, column: 6 }, + end: { line: 1, column: 9 } } }, - range: [11, 16], + range: [5, 10], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 10 } + } + }, + range: [3, 10], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 10 } + } + }, + { + type: "XJSAttribute", + name: { + type: "XJSIdentifier", + name: "c", + range: [11, 12], loc: { start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + value: { + type: "Literal", + value: " ", + raw: "\" \"", + range: [13, 16], + loc: { + start: { line: 1, column: 13 }, end: { line: 1, column: 16 } } }, - { - type: "XJSAttribute", - name: { - type: "XJSIdentifier", - name: "d", - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - value: { - type: "Literal", - value: "&", - raw: "\"&\"", - range: [19, 26], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 26 } - } - }, - range: [17, 26], + range: [11, 16], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 16 } + } + }, + { + type: "XJSAttribute", + name: { + type: "XJSIdentifier", + name: "d", + range: [17, 18], loc: { start: { line: 1, column: 17 }, + end: { line: 1, column: 18 } + } + }, + value: { + type: "Literal", + value: "&", + raw: "\"&\"", + range: [19, 26], + loc: { + start: { line: 1, column: 19 }, end: { line: 1, column: 26 } } + }, + range: [17, 26], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 26 } } - ], - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } } - }, - children: [], + ], range: [0, 29], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 29 } } }, + children: [], range: [0, 29], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 29 } } }, - '': { - type: "ExpressionStatement", - expression: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "a", - range: [ - 1, - 2 - ], - loc: { - start: { - line: 1, - column: 1 - }, - end: { - line: 1, - column: 2 - } - } - }, - selfClosing: true, - attributes: [], + range: [0, 29], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 29 } + } + }, + '': { + type: "ExpressionStatement", + expression: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "a", range: [ - 0, - 5 + 1, + 2 ], loc: { start: { line: 1, - column: 0 + column: 1 }, end: { - line: 2, + line: 1, column: 2 } } }, - children: [], + selfClosing: true, + attributes: [], range: [ 0, 5 @@ -515,6 +496,7 @@ var fbTestFixture = { } } }, + children: [], range: [ 0, 5 @@ -530,98 +512,98 @@ var fbTestFixture = { } } }, - '<日本語>': { - type: "ExpressionStatement", - expression: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "日本語", - range: [ - 1, - 4 - ], - loc: { - start: { - line: 1, - column: 1 - }, - end: { - line: 1, - column: 4 - } - } - }, - selfClosing: false, - attributes: [], + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 2, + column: 2 + } + } + }, + '<日本語>': { + type: "ExpressionStatement", + expression: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "日本語", range: [ - 0, - 5 + 1, + 4 ], loc: { start: { line: 1, - column: 0 + column: 1 }, end: { line: 1, - column: 5 + column: 4 } } }, - closingElement: { - type: "XJSClosingElement", - name: { - type: "XJSIdentifier", - name: "日本語", - range: [ - 7, - 10 - ], - loc: { - start: { - line: 1, - column: 7 - }, - end: { - line: 1, - column: 10 - } - } - }, - range: [ - 5, - 11 - ], - loc: { - start: { - line: 1, - column: 5 - }, - end: { - line: 1, - column: 11 - } - } - }, - children: [], + selfClosing: false, + attributes: [], range: [ 0, - 11 + 5 ], loc: { start: { line: 1, column: 0 }, + end: { + line: 1, + column: 5 + } + } + }, + closingElement: { + type: "XJSClosingElement", + name: { + type: "XJSIdentifier", + name: "日本語", + range: [ + 7, + 10 + ], + loc: { + start: { + line: 1, + column: 7 + }, + end: { + line: 1, + column: 10 + } + } + }, + range: [ + 5, + 11 + ], + loc: { + start: { + line: 1, + column: 5 + }, end: { line: 1, column: 11 } } }, + children: [], range: [ 0, 11 @@ -637,174 +619,174 @@ var fbTestFixture = { } } }, + range: [ + 0, + 11 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 11 + } + } + }, - '\nbar\nbaz\r\n': { - type: "ExpressionStatement", - expression: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "AbC-def", - range: [ - 1, - 8 - ], - loc: { - start: { - line: 1, - column: 1 - }, - end: { - line: 1, - column: 8 - } + '\nbar\nbaz\r\n': { + type: "ExpressionStatement", + expression: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "AbC-def", + range: [ + 1, + 8 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 8 } - }, - selfClosing: false, - attributes: [ - { - type: "XJSAttribute", - name: { - type: "XJSIdentifier", - name: "test", - range: [ - 11, - 15 - ], - loc: { - start: { - line: 2, - column: 2 - }, - end: { - line: 2, - column: 6 - } - } - }, - value: { - type: "Literal", - value: "&&", - raw: "\"&&\"", - range: [ - 16, - 31 - ], - loc: { - start: { - line: 2, - column: 7 - }, - end: { - line: 2, - column: 22 - } - } - }, + } + }, + selfClosing: false, + attributes: [ + { + type: "XJSAttribute", + name: { + type: "XJSIdentifier", + name: "test", range: [ 11, - 31 + 15 ], loc: { start: { line: 2, column: 2 }, + end: { + line: 2, + column: 6 + } + } + }, + value: { + type: "Literal", + value: "&&", + raw: "\"&&\"", + range: [ + 16, + 31 + ], + loc: { + start: { + line: 2, + column: 7 + }, end: { line: 2, column: 22 } } - } - ], - range: [ - 0, - 32 - ], - loc: { - start: { - line: 1, - column: 0 }, - end: { - line: 2, - column: 23 - } - } - }, - closingElement: { - type: "XJSClosingElement", - name: { - type: "XJSIdentifier", - name: "AbC-def", range: [ - 44, - 51 - ], - loc: { - start: { - line: 5, - column: 2 - }, - end: { - line: 5, - column: 9 - } - } - }, - range: [ - 42, - 52 - ], - loc: { - start: { - line: 5, - column: 0 - }, - end: { - line: 5, - column: 10 - } - } - }, - children: [ - { - type: "Literal", - value: "\nbar\nbaz\r\n", - raw: "\nbar\nbaz\r\n", - range: [ - 32, - 42 + 11, + 31 ], loc: { start: { line: 2, - column: 23 + column: 2 }, end: { - line: 5, - column: 0 + line: 2, + column: 22 } } } ], range: [ 0, - 52 + 32 ], loc: { start: { line: 1, column: 0 }, + end: { + line: 2, + column: 23 + } + } + }, + closingElement: { + type: "XJSClosingElement", + name: { + type: "XJSIdentifier", + name: "AbC-def", + range: [ + 44, + 51 + ], + loc: { + start: { + line: 5, + column: 2 + }, + end: { + line: 5, + column: 9 + } + } + }, + range: [ + 42, + 52 + ], + loc: { + start: { + line: 5, + column: 0 + }, end: { line: 5, column: 10 } } }, + children: [ + { + type: "Literal", + value: "\nbar\nbaz\r\n", + raw: "\nbar\nbaz\r\n", + range: [ + 32, + 42 + ], + loc: { + start: { + line: 2, + column: 23 + }, + end: { + line: 5, + column: 0 + } + } + } + ], range: [ 0, 52 @@ -820,115 +802,114 @@ var fbTestFixture = { } } }, + range: [ + 0, + 52 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 5, + column: 10 + } + } + }, - ' : } />': { - type: "ExpressionStatement", - expression: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "a", - range: [ - 1, - 2 - ], - loc: { - start: { - line: 1, - column: 1 - }, - end: { - line: 1, - column: 2 - } + ' : } />': { + type: "ExpressionStatement", + expression: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "a", + range: [ + 1, + 2 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 2 } - }, - selfClosing: true, - attributes: [ - { - type: "XJSAttribute", - name: { - type: "XJSIdentifier", - name: "b", - range: [ - 3, - 4 - ], - loc: { - start: { - line: 1, - column: 3 - }, - end: { - line: 1, - column: 4 - } + } + }, + selfClosing: true, + attributes: [ + { + type: "XJSAttribute", + name: { + type: "XJSIdentifier", + name: "b", + range: [ + 3, + 4 + ], + loc: { + start: { + line: 1, + column: 3 + }, + end: { + line: 1, + column: 4 } - }, - value: { - type: "XJSExpressionContainer", - expression: { - type: "ConditionalExpression", - test: { - type: "Identifier", - name: "x", - range: [ - 6, - 7 - ], - loc: { - start: { - line: 1, - column: 6 - }, - end: { - line: 1, - column: 7 - } + } + }, + value: { + type: "XJSExpressionContainer", + expression: { + type: "ConditionalExpression", + test: { + type: "Identifier", + name: "x", + range: [ + 6, + 7 + ], + loc: { + start: { + line: 1, + column: 6 + }, + end: { + line: 1, + column: 7 } - }, - consequent: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "c", - range: [ - 11, - 12 - ], - loc: { - start: { - line: 1, - column: 11 - }, - end: { - line: 1, - column: 12 - } - } - }, - selfClosing: true, - attributes: [], + } + }, + consequent: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "c", range: [ - 10, - 15 + 11, + 12 ], loc: { start: { line: 1, - column: 10 + column: 11 }, end: { line: 1, - column: 15 + column: 12 } } }, - children: [], + selfClosing: true, + attributes: [], range: [ 10, 15 @@ -944,46 +925,46 @@ var fbTestFixture = { } } }, - alternate: { - type: "XJSElement", - openingElement: { - type: "XJSOpeningElement", - name: { - type: "XJSIdentifier", - name: "d", - range: [ - 19, - 20 - ], - loc: { - start: { - line: 1, - column: 19 - }, - end: { - line: 1, - column: 20 - } - } - }, - selfClosing: true, - attributes: [], + children: [], + range: [ + 10, + 15 + ], + loc: { + start: { + line: 1, + column: 10 + }, + end: { + line: 1, + column: 15 + } + } + }, + alternate: { + type: "XJSElement", + openingElement: { + type: "XJSOpeningElement", + name: { + type: "XJSIdentifier", + name: "d", range: [ - 18, - 23 + 19, + 20 ], loc: { start: { line: 1, - column: 18 + column: 19 }, end: { line: 1, - column: 23 + column: 20 } } }, - children: [], + selfClosing: true, + attributes: [], range: [ 18, 23 @@ -999,14 +980,15 @@ var fbTestFixture = { } } }, + children: [], range: [ - 6, + 18, 23 ], loc: { start: { line: 1, - column: 6 + column: 18 }, end: { line: 1, @@ -1015,52 +997,51 @@ var fbTestFixture = { } }, range: [ - 5, - 24 + 6, + 23 ], loc: { start: { line: 1, - column: 5 + column: 6 }, end: { line: 1, - column: 24 + column: 23 } } }, range: [ - 3, + 5, 24 ], loc: { start: { line: 1, - column: 3 + column: 5 }, end: { line: 1, column: 24 } } - } - ], - range: [ - 0, - 27 - ], - loc: { - start: { - line: 1, - column: 0 }, - end: { - line: 1, - column: 27 + range: [ + 3, + 24 + ], + loc: { + start: { + line: 1, + column: 3 + }, + end: { + line: 1, + column: 24 + } } } - }, - children: [], + ], range: [ 0, 27 @@ -1076,6 +1057,7 @@ var fbTestFixture = { } } }, + children: [], range: [ 0, 27 @@ -1091,324 +1073,323 @@ var fbTestFixture = { } } }, + range: [ + 0, + 27 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 27 + } + } + }, - '{}': { - type: 'ExpressionStatement', - expression: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSIdentifier', - name: 'a', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - selfClosing: false, - attributes: [], - range: [0, 3], + '{}': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSIdentifier', + name: 'a', + range: [1, 2], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - closingElement: { - type: 'XJSClosingElement', - name: { - type: 'XJSIdentifier', - name: 'a', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - range: [5, 9], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 9 } - } - }, - children: [{ - type: 'XJSExpressionContainer', - expression: { - type: 'XJSEmptyExpression', - range: [4, 4], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 4 } - } - }, - range: [3, 5], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 5 } - } - }], - range: [0, 9], + selfClosing: false, + attributes: [], + range: [0, 3], loc: { start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSIdentifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, end: { line: 1, column: 9 } } }, + children: [{ + type: 'XJSExpressionContainer', + expression: { + type: 'XJSEmptyExpression', + range: [4, 4], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 4 } + } + }, + range: [3, 5], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 5 } + } + }], range: [0, 9], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 9 } } }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, - '{/* this is a comment */}': { - type: 'ExpressionStatement', - expression: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSIdentifier', - name: 'a', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - selfClosing: false, - attributes: [], - range: [0, 3], + '{/* this is a comment */}': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSIdentifier', + name: 'a', + range: [1, 2], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } } }, - closingElement: { - type: 'XJSClosingElement', - name: { - type: 'XJSIdentifier', - name: 'a', - range: [30, 31], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 31 } - } - }, - range: [28, 32], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 32 } - } - }, - children: [{ - type: 'XJSExpressionContainer', - expression: { - type: 'XJSEmptyExpression', - range: [4, 27], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 27 } - } - }, - range: [3, 28], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 28 } - } - }], - range: [0, 32], + selfClosing: false, + attributes: [], + range: [0, 3], loc: { start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSIdentifier', + name: 'a', + range: [30, 31], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 31 } + } + }, + range: [28, 32], + loc: { + start: { line: 1, column: 28 }, end: { line: 1, column: 32 } } }, + children: [{ + type: 'XJSExpressionContainer', + expression: { + type: 'XJSEmptyExpression', + range: [4, 27], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 27 } + } + }, + range: [3, 28], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 28 } + } + }], range: [0, 32], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 32 } } }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, - '
@test content
': { - type: 'ExpressionStatement', - expression: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSIdentifier', - name: 'div', - range: [1, 4], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 4 } - } - }, - selfClosing: false, - attributes: [], - range: [0, 5], + '
@test content
': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSIdentifier', + name: 'div', + range: [1, 4], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } } }, - closingElement: { - type: 'XJSClosingElement', - name: { - type: 'XJSIdentifier', - name: 'div', - range: [20, 23], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } - } - }, - range: [18, 24], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 24 } - } - }, - children: [{ - type: 'Literal', - value: '@test content', - raw: '@test content', - range: [5, 18], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 18 } - } - }], - range: [0, 24], + selfClosing: false, + attributes: [], + range: [0, 5], loc: { start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSIdentifier', + name: 'div', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + range: [18, 24], + loc: { + start: { line: 1, column: 18 }, end: { line: 1, column: 24 } } }, + children: [{ + type: 'Literal', + value: '@test content', + raw: '@test content', + range: [5, 18], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 18 } + } + }], range: [0, 24], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 24 } } }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, - '

7x invalid-js-identifier
': { - type: 'ExpressionStatement', - expression: { + '

7x invalid-js-identifier
': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSIdentifier', + name: 'div', + range: [ + 1, + 4 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 4 + } + } + }, + selfClosing: false, + attributes: [], + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 5 + } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSIdentifier', + name: 'div', + range: [ + 37, + 40 + ], + loc: { + start: { + line: 1, + column: 37 + }, + end: { + line: 1, + column: 40 + } + } + }, + range: [ + 35, + 41 + ], + loc: { + start: { + line: 1, + column: 35 + }, + end: { + line: 1, + column: 41 + } + } + }, + children: [{ type: 'XJSElement', openingElement: { type: 'XJSOpeningElement', name: { type: 'XJSIdentifier', - name: 'div', + name: 'br', range: [ - 1, - 4 + 6, + 8 ], loc: { start: { line: 1, - column: 1 + column: 6 }, end: { line: 1, - column: 4 + column: 8 } } }, - selfClosing: false, + selfClosing: true, attributes: [], - range: [ - 0, - 5 - ], - loc: { - start: { - line: 1, - column: 0 - }, - end: { - line: 1, - column: 5 - } - } - }, - closingElement: { - type: 'XJSClosingElement', - name: { - type: 'XJSIdentifier', - name: 'div', - range: [ - 37, - 40 - ], - loc: { - start: { - line: 1, - column: 37 - }, - end: { - line: 1, - column: 40 - } - } - }, - range: [ - 35, - 41 - ], - loc: { - start: { - line: 1, - column: 35 - }, - end: { - line: 1, - column: 41 - } - } - }, - children: [{ - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSIdentifier', - name: 'br', - range: [ - 6, - 8 - ], - loc: { - start: { - line: 1, - column: 6 - }, - end: { - line: 1, - column: 8 - } - } - }, - selfClosing: true, - attributes: [], - range: [ - 5, - 11 - ], - loc: { - start: { - line: 1, - column: 5 - }, - end: { - line: 1, - column: 11 - } - } - }, - children: [], range: [ 5, 11 @@ -1423,40 +1404,41 @@ var fbTestFixture = { column: 11 } } - }, { - type: 'Literal', - value: '7x invalid-js-identifier', - raw: '7x invalid-js-identifier', - range: [ - 11, - 35 - ], - loc: { - start: { - line: 1, - column: 11 - }, - end: { - line: 1, - column: 35 - } - } - }], + }, + children: [], range: [ - 0, - 41 + 5, + 11 ], loc: { start: { line: 1, - column: 0 + column: 5 }, end: { line: 1, - column: 41 + column: 11 } } - }, + }, { + type: 'Literal', + value: '7x invalid-js-identifier', + raw: '7x invalid-js-identifier', + range: [ + 11, + 35 + ], + loc: { + start: { + line: 1, + column: 11 + }, + end: { + line: 1, + column: 35 + } + } + }], range: [ 0, 41 @@ -1472,93 +1454,92 @@ var fbTestFixture = { } } }, + range: [ + 0, + 41 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 41 + } + } + }, - ' right=monkeys /> gorillas />': { - "type": "ExpressionStatement", - "expression": { - "type": "XJSElement", - "openingElement": { - "type": "XJSOpeningElement", - "name": { - "type": "XJSIdentifier", - "name": "LeftRight", - "range": [ - 1, - 10 - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } + ' right=monkeys /> gorillas />': { + "type": "ExpressionStatement", + "expression": { + "type": "XJSElement", + "openingElement": { + "type": "XJSOpeningElement", + "name": { + "type": "XJSIdentifier", + "name": "LeftRight", + "range": [ + 1, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 } - }, - "selfClosing": true, - "attributes": [ - { - "type": "XJSAttribute", - "name": { - "type": "XJSIdentifier", - "name": "left", - "range": [ - 11, - 15 - ], - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } + } + }, + "selfClosing": true, + "attributes": [ + { + "type": "XJSAttribute", + "name": { + "type": "XJSIdentifier", + "name": "left", + "range": [ + 11, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 } - }, - "value": { - "type": "XJSElement", - "openingElement": { - "type": "XJSOpeningElement", - "name": { - "type": "XJSIdentifier", - "name": "a", - "range": [ - 17, - 18 - ], - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - "selfClosing": true, - "attributes": [], + } + }, + "value": { + "type": "XJSElement", + "openingElement": { + "type": "XJSOpeningElement", + "name": { + "type": "XJSIdentifier", + "name": "a", "range": [ - 16, - 21 + 17, + 18 ], "loc": { "start": { "line": 1, - "column": 16 + "column": 17 }, "end": { "line": 1, - "column": 21 + "column": 18 } } }, - "children": [], + "selfClosing": true, + "attributes": [], "range": [ 16, 21 @@ -1574,14 +1555,15 @@ var fbTestFixture = { } } }, + "children": [], "range": [ - 11, + 16, 21 ], "loc": { "start": { "line": 1, - "column": 11 + "column": 16 }, "end": { "line": 1, @@ -1589,168 +1571,167 @@ var fbTestFixture = { } } }, - { - "type": "XJSAttribute", - "name": { - "type": "XJSIdentifier", - "name": "right", - "range": [ - 22, - 27 - ], - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - } - }, - "value": { - "type": "XJSElement", - "openingElement": { - "type": "XJSOpeningElement", - "name": { - "type": "XJSIdentifier", - "name": "b", - "range": [ - 29, - 30 - ], - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "selfClosing": false, - "attributes": [], - "range": [ - 28, - 31 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - } - }, - "closingElement": { - "type": "XJSClosingElement", - "name": { - "type": "XJSIdentifier", - "name": "b", - "range": [ - 52, - 53 - ], - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - } - }, - "range": [ - 50, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 54 - } - } - }, - "children": [ - { - "type": "Literal", - "value": "monkeys /> gorillas", - "raw": "monkeys /> gorillas", - "range": [ - 31, - 50 - ], - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 50 - } - } - } - ], - "range": [ - 28, - 54 - ], - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 54 - } - } + "range": [ + 11, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 11 }, + "end": { + "line": 1, + "column": 21 + } + } + }, + { + "type": "XJSAttribute", + "name": { + "type": "XJSIdentifier", + "name": "right", "range": [ 22, - 54 + 27 ], "loc": { "start": { "line": 1, "column": 22 }, + "end": { + "line": 1, + "column": 27 + } + } + }, + "value": { + "type": "XJSElement", + "openingElement": { + "type": "XJSOpeningElement", + "name": { + "type": "XJSIdentifier", + "name": "b", + "range": [ + 29, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + } + }, + "selfClosing": false, + "attributes": [], + "range": [ + 28, + 31 + ], + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + } + }, + "closingElement": { + "type": "XJSClosingElement", + "name": { + "type": "XJSIdentifier", + "name": "b", + "range": [ + 52, + 53 + ], + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + } + }, + "range": [ + 50, + 54 + ], + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 54 + } + } + }, + "children": [ + { + "type": "Literal", + "value": "monkeys /> gorillas", + "raw": "monkeys /> gorillas", + "range": [ + 31, + 50 + ], + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 50 + } + } + } + ], + "range": [ + 28, + 54 + ], + "loc": { + "start": { + "line": 1, + "column": 28 + }, "end": { "line": 1, "column": 54 } } - } - ], - "range": [ - 0, - 57 - ], - "loc": { - "start": { - "line": 1, - "column": 0 }, - "end": { - "line": 1, - "column": 57 + "range": [ + 22, + 54 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 54 + } } } - }, - "children": [], + ], "range": [ 0, 57 @@ -1766,6 +1747,7 @@ var fbTestFixture = { } } }, + "children": [], "range": [ 0, 57 @@ -1781,14 +1763,119 @@ var fbTestFixture = { } } }, + "range": [ + 0, + 57 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + } + }, - '': { - type: 'ExpressionStatement', - expression: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { + '': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSMemberExpression', + object: { + type: 'XJSIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + property: { + type: 'XJSIdentifier', + name: 'b', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, + selfClosing: false, + attributes: [], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSMemberExpression', + object: { + type: 'XJSIdentifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'XJSIdentifier', + name: 'b', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + range: [7, 10], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 10 } + } + }, + range: [5, 11], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } + } + }, + children: [], + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '': { + type: 'ExpressionStatement', + expression: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSMemberExpression', + object: { type: 'XJSMemberExpression', object: { type: 'XJSIdentifier', @@ -1814,247 +1901,156 @@ var fbTestFixture = { end: { line: 1, column: 4 } } }, - selfClosing: false, - attributes: [], - range: [0, 5], + property: { + type: 'XJSIdentifier', + name: 'c', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [1, 6], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 6 } } }, - closingElement: { - type: 'XJSClosingElement', - name: { + selfClosing: false, + attributes: [], + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + closingElement: { + type: 'XJSClosingElement', + name: { + type: 'XJSMemberExpression', + object: { type: 'XJSMemberExpression', object: { type: 'XJSIdentifier', name: 'a', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'XJSIdentifier', - name: 'b', range: [9, 10], loc: { start: { line: 1, column: 9 }, end: { line: 1, column: 10 } } }, - range: [7, 10], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 10 } - } - }, - range: [5, 11], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 11 } - } - }, - children: [], - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - '': { - type: 'ExpressionStatement', - expression: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSMemberExpression', - object: { - type: 'XJSMemberExpression', - object: { - type: 'XJSIdentifier', - name: 'a', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - property: { - type: 'XJSIdentifier', - name: 'b', - range: [3, 4], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } - } - }, - range: [1, 4], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 4 } - } - }, property: { type: 'XJSIdentifier', - name: 'c', - range: [5, 6], + name: 'b', + range: [11, 12], loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [1, 6], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 6 } - } - }, - selfClosing: false, - attributes: [], - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - closingElement: { - type: 'XJSClosingElement', - name: { - type: 'XJSMemberExpression', - object: { - type: 'XJSMemberExpression', - object: { - type: 'XJSIdentifier', - name: 'a', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - property: { - type: 'XJSIdentifier', - name: 'b', - range: [11, 12], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } - } - }, - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, + start: { line: 1, column: 11 }, end: { line: 1, column: 12 } } }, - property: { - type: 'XJSIdentifier', - name: 'c', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }, - range: [9, 14], + range: [9, 12], loc: { start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'XJSIdentifier', + name: 'c', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, end: { line: 1, column: 14 } } }, - range: [7, 15], + range: [9, 14], loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 15 } + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } } }, - children: [], - range: [0, 15], + range: [7, 15], loc: { - start: { line: 1, column: 0 }, + start: { line: 1, column: 7 }, end: { line: 1, column: 15 } } }, + children: [], range: [0, 15], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } } }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, - // In order to more useful parse errors, we disallow following an - // XJSElement by a less-than symbol. In the rare case that the binary - // operator was intended, the tag can be wrapped in parentheses: - '(
) < x;': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'XJSElement', - openingElement: { - type: 'XJSOpeningElement', - name: { - type: 'XJSIdentifier', - name: 'div', - range: [2, 5], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 5 } - } - }, - selfClosing: true, - attributes: [], - range: [1, 8], + // In order to more useful parse errors, we disallow following an + // XJSElement by a less-than symbol. In the rare case that the binary + // operator was intended, the tag can be wrapped in parentheses: + '(
) < x;': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'XJSElement', + openingElement: { + type: 'XJSOpeningElement', + name: { + type: 'XJSIdentifier', + name: 'div', + range: [2, 5], loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 8 } + start: { line: 1, column: 2 }, + end: { line: 1, column: 5 } } }, - children: [], - range: [0, 9], + selfClosing: true, + attributes: [], + range: [1, 8], loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } + start: { line: 1, column: 1 }, + end: { line: 1, column: 8 } } }, - right: { - type: 'Identifier', - name: 'x', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], + children: [], + range: [0, 9], loc: { start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + right: { + type: 'Identifier', + name: 'x', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, end: { line: 1, column: 13 } } }, - range: [0, 14], + range: [0, 13], loc: { start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } + end: { line: 1, column: 13 } } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } } } }; -for (var code in fbTestFixture.XJS) { +for (var code in fbTestFixture) { test(code, { type: 'Program', - body: [fbTestFixture.XJS[code]] + body: [fbTestFixture[code]] }, {locations: true, ranges: true}); } \ No newline at end of file