Started porting JSX support from esprima-fb.

Conflicts:
	acorn.js
	test/tests.js
This commit is contained in:
Ingvar Stepanyan
2014-07-08 17:44:55 +03:00
parent 40f1c67161
commit 283d47c038
3 changed files with 204 additions and 1 deletions

53
test/tests-jsx.js Normal file
View File

@@ -0,0 +1,53 @@
// React JSX tests
if (typeof exports != "undefined") {
var test = require("./driver.js").test;
var testFail = require("./driver.js").testFail;
var testAssert = require("./driver.js").testAssert;
}
test('<a />', {
type: 'Program',
body: [
{
type: "ExpressionStatement",
expression: {
type: "XJSElement",
openingElement: {
type: "XJSOpeningElement",
name: {
type: "XJSIdentifier",
name: "a",
start: 1,
end: 2,
loc: {
start: { line: 1, column: 1 },
end: { line: 1, column: 2 }
}
},
selfClosing: true,
attributes: [],
start: 0,
end: 5,
loc: {
start: { line: 1, column: 0 },
end: { line: 1, column: 5 }
}
},
children: [],
start: 0,
end: 5,
loc: {
start: { line: 1, column: 0 },
end: { line: 1, column: 5 }
}
},
start: 0,
end: 5,
loc: {
start: { line: 1, column: 0 },
end: { line: 1, column: 5 }
}
}
]
}, {locations: true});

View File

@@ -6,6 +6,7 @@ if (typeof exports != "undefined") {
var testFail = require("./driver.js").testFail;
var testAssert = require("./driver.js").testAssert;
var acorn = require("..");
require("./tests-jsx.js");
}
test("this\n", {