update acorn-to-esprima, add getter/setter tests
This commit is contained in:
parent
fa7dfc272a
commit
318a530dfa
@ -8,7 +8,7 @@
|
|||||||
"url": "https://github.com/babel/babel-eslint.git"
|
"url": "https://github.com/babel/babel-eslint.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn-to-esprima": "^2.0.1",
|
"acorn-to-esprima": "^2.0.3",
|
||||||
"babel-traverse": "^6.0.20",
|
"babel-traverse": "^6.0.20",
|
||||||
"babel-types": "^6.0.19",
|
"babel-types": "^6.0.19",
|
||||||
"babylon": "^6.0.18",
|
"babylon": "^6.0.18",
|
||||||
|
|||||||
@ -370,7 +370,8 @@ describe("acorn-to-esprima", function () {
|
|||||||
" a,",
|
" a,",
|
||||||
" b,",
|
" b,",
|
||||||
" c",
|
" c",
|
||||||
" ) {",
|
" )",
|
||||||
|
"{",
|
||||||
"",
|
"",
|
||||||
" }",
|
" }",
|
||||||
"}"
|
"}"
|
||||||
@ -409,5 +410,28 @@ describe("acorn-to-esprima", function () {
|
|||||||
parseAndAssertSame("");
|
parseAndAssertSame("");
|
||||||
parseAndAssertSame("a");
|
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"));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user