update acorn-to-esprima, add getter/setter tests

This commit is contained in:
Henry Zhu 2015-12-09 08:27:19 -05:00
parent fa7dfc272a
commit 318a530dfa
2 changed files with 27 additions and 3 deletions

View File

@ -8,7 +8,7 @@
"url": "https://github.com/babel/babel-eslint.git"
},
"dependencies": {
"acorn-to-esprima": "^2.0.1",
"acorn-to-esprima": "^2.0.3",
"babel-traverse": "^6.0.20",
"babel-types": "^6.0.19",
"babylon": "^6.0.18",

View File

@ -366,11 +366,12 @@ describe("acorn-to-esprima", function () {
it("ClassMethod multiline", function () {
parseAndAssertSame([
"class A {",
" constructor(",
" constructor (",
" a,",
" b,",
" c",
" ) {",
" )",
"{",
"",
" }",
"}"
@ -409,5 +410,28 @@ describe("acorn-to-esprima", function () {
parseAndAssertSame("");
parseAndAssertSame("a");
});
it("getters and setters", function () {
parseAndAssertSame("class A { get x ( ) { ; } }");
parseAndAssertSame([
"class A {",
"get x(",
")",
"{",
";",
"}",
"}"
].join("\n"));
parseAndAssertSame("class A { set x (a) { ; } }");
parseAndAssertSame([
"class A {",
"set x(a",
")",
"{",
";",
"}",
"}"
].join("\n"));
});
});
});