add TSParameterProperty to typescript ast nodes (#1507)

master
Danny Arnold 2017-05-04 20:19:50 +02:00 committed by Christopher Chedeau
parent c1a8ee011d
commit 14636947b6
4 changed files with 25 additions and 0 deletions

View File

@ -169,4 +169,7 @@ module.exports = function(fork) {
.build("expression")
.field("expression", def("Identifier"))
.bases("Node");
def("TSParameterProperty")
.build("accessibility", "isReadonly", "parameters")
};

View File

@ -0,0 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`parameterProperty.ts 1`] = `
class c3 {
constructor(public arg: number = 10) {
// fails because of comment
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class c3 {
constructor(public arg: number = 10) {
// fails because of comment
}
}
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, { parser: "typescript" });

View File

@ -0,0 +1,5 @@
class c3 {
constructor(public arg: number = 10) {
// fails because of comment
}
}