Merge branch 'master' of https://github.com/RReverser/acorn-jsx
Conflicts: package.json
This commit is contained in:
commit
6b4f40f556
9
acorn.js
9
acorn.js
@ -2607,6 +2607,8 @@
|
||||
function parseObj() {
|
||||
var node = startNode(), first = true, propHash = {};
|
||||
node.properties = [];
|
||||
var origInXJSChildExpression = inXJSChildExpression;
|
||||
inXJSChildExpression = false;
|
||||
next();
|
||||
while (!eat(_braceR)) {
|
||||
if (!first) {
|
||||
@ -2646,9 +2648,10 @@
|
||||
|
||||
checkPropClash(prop, propHash);
|
||||
node.properties.push(finishNode(prop, "Property"));
|
||||
}
|
||||
}
|
||||
inXJSChildExpression = origInXJSChildExpression;
|
||||
return finishNode(node, "ObjectExpression");
|
||||
}
|
||||
}
|
||||
|
||||
function parsePropertyName(prop) {
|
||||
if (options.ecmaVersion >= 6) {
|
||||
@ -3245,7 +3248,7 @@
|
||||
inXJSTag = origInXJSTag;
|
||||
inXJSChild = origInXJSChild;
|
||||
inXJSChildExpression = false;
|
||||
|
||||
|
||||
expect(_braceR);
|
||||
return finishNode(node, "XJSExpressionContainer");
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "acorn-6to5",
|
||||
"description": "Acorn fork used by 6to5",
|
||||
"main": "acorn.js",
|
||||
"version": "0.9.1-3",
|
||||
"version": "0.9.1-4",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Marijn Haverbeke",
|
||||
|
||||
@ -3306,80 +3306,141 @@ var fbTestFixture = {
|
||||
},
|
||||
|
||||
'<div>{<div {...test} />}</div>': {
|
||||
type: 'Program',
|
||||
type: 'ExpressionStatement',
|
||||
start: 0,
|
||||
end: 30,
|
||||
body: [{
|
||||
type: 'ExpressionStatement',
|
||||
expression: {
|
||||
type: 'XJSElement',
|
||||
start: 0,
|
||||
end: 30,
|
||||
expression: {
|
||||
type: 'XJSElement',
|
||||
openingElement: {
|
||||
type: 'XJSOpeningElement',
|
||||
start: 0,
|
||||
end: 5,
|
||||
attributes: [],
|
||||
name: {
|
||||
type: 'XJSIdentifier',
|
||||
start: 1,
|
||||
end: 4,
|
||||
name: 'div'
|
||||
},
|
||||
selfClosing: false
|
||||
},
|
||||
closingElement: {
|
||||
type: 'XJSClosingElement',
|
||||
start: 24,
|
||||
end: 30,
|
||||
openingElement: {
|
||||
type: 'XJSOpeningElement',
|
||||
start: 0,
|
||||
end: 5,
|
||||
attributes: [],
|
||||
name: {
|
||||
type: 'XJSIdentifier',
|
||||
start: 1,
|
||||
end: 4,
|
||||
name: 'div'
|
||||
},
|
||||
selfClosing: false
|
||||
},
|
||||
closingElement: {
|
||||
type: 'XJSClosingElement',
|
||||
start: 24,
|
||||
end: 30,
|
||||
name: {
|
||||
type: 'XJSIdentifier',
|
||||
start: 26,
|
||||
end: 29,
|
||||
name: 'div'
|
||||
}
|
||||
},
|
||||
children: [{
|
||||
type: 'XJSExpressionContainer',
|
||||
start: 5,
|
||||
end: 24,
|
||||
expression: {
|
||||
type: 'XJSElement',
|
||||
name: {
|
||||
type: 'XJSIdentifier',
|
||||
start: 26,
|
||||
end: 29,
|
||||
name: 'div'
|
||||
}
|
||||
},
|
||||
children: [{
|
||||
type: 'XJSExpressionContainer',
|
||||
start: 5,
|
||||
end: 24,
|
||||
expression: {
|
||||
type: 'XJSElement',
|
||||
start: 6,
|
||||
end: 23,
|
||||
openingElement: {
|
||||
type: 'XJSOpeningElement',
|
||||
start: 6,
|
||||
end: 23,
|
||||
openingElement: {
|
||||
type: 'XJSOpeningElement',
|
||||
start: 6,
|
||||
end: 23,
|
||||
attributes: [
|
||||
{
|
||||
type: 'XJSSpreadAttribute',
|
||||
start: 11,
|
||||
end: 20,
|
||||
argument: {
|
||||
type: 'Identifier',
|
||||
start: 15,
|
||||
end: 19,
|
||||
name: 'test'
|
||||
}
|
||||
attributes: [
|
||||
{
|
||||
type: 'XJSSpreadAttribute',
|
||||
start: 11,
|
||||
end: 20,
|
||||
argument: {
|
||||
type: 'Identifier',
|
||||
start: 15,
|
||||
end: 19,
|
||||
name: 'test'
|
||||
}
|
||||
],
|
||||
name: {
|
||||
type: 'XJSIdentifier',
|
||||
start: 7,
|
||||
end: 10,
|
||||
name: 'div'
|
||||
},
|
||||
selfClosing: true
|
||||
}
|
||||
],
|
||||
name: {
|
||||
type: 'XJSIdentifier',
|
||||
start: 7,
|
||||
end: 10,
|
||||
name: 'div'
|
||||
},
|
||||
closingElement: null,
|
||||
children: []
|
||||
}
|
||||
}]
|
||||
}
|
||||
}]
|
||||
selfClosing: true
|
||||
},
|
||||
closingElement: null,
|
||||
children: []
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
'<div>{ {a} }</div>': {
|
||||
type: "ExpressionStatement",
|
||||
start: 0,
|
||||
end: 18,
|
||||
expression: {
|
||||
type: "XJSElement",
|
||||
start: 0,
|
||||
end: 18,
|
||||
openingElement: {
|
||||
type: "XJSOpeningElement",
|
||||
start: 0,
|
||||
end: 5,
|
||||
attributes: [],
|
||||
name: {
|
||||
type: "XJSIdentifier",
|
||||
start: 1,
|
||||
end: 4,
|
||||
name: "div"
|
||||
},
|
||||
selfClosing: false
|
||||
},
|
||||
closingElement: {
|
||||
type: "XJSClosingElement",
|
||||
start: 12,
|
||||
end: 18,
|
||||
name: {
|
||||
type: "XJSIdentifier",
|
||||
start: 14,
|
||||
end: 17,
|
||||
name: "div"
|
||||
}
|
||||
},
|
||||
children: [{
|
||||
type: "XJSExpressionContainer",
|
||||
start: 5,
|
||||
end: 12,
|
||||
expression: {
|
||||
type: "ObjectExpression",
|
||||
start: 7,
|
||||
end: 10,
|
||||
properties: [{
|
||||
type: "Property",
|
||||
start: 8,
|
||||
end: 9,
|
||||
method: false,
|
||||
shorthand: true,
|
||||
computed: false,
|
||||
key: {
|
||||
type: "Identifier",
|
||||
start: 8,
|
||||
end: 9,
|
||||
name: "a"
|
||||
},
|
||||
kind: "init",
|
||||
value: {
|
||||
type: "Identifier",
|
||||
start: 8,
|
||||
end: 9,
|
||||
name: "a"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user