Skip to content

Commit d4c6f87

Browse files
committed
add test for auto-accessors
1 parent 65567fa commit d4c6f87

File tree

3 files changed

+93
-18
lines changed

3 files changed

+93
-18
lines changed

javascript/ql/test/library-tests/TypeScript/Types/printAst.expected

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ nodes
136136
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
137137
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
138138
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
139+
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
139140
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
140141
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
141142
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
@@ -1426,8 +1427,8 @@ nodes
14261427
| tst.ts:385:56:385:56 | [Literal] 0 | semmle.label | [Literal] 0 |
14271428
| tst.ts:385:59:385:63 | [Literal] false | semmle.label | [Literal] false |
14281429
| tst.ts:385:66:385:71 | [Literal] "bye!" | semmle.label | [Literal] "bye!" |
1429-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | semmle.label | [NamespaceDeclaration] module ... } } } |
1430-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | semmle.order | 85 |
1430+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | semmle.label | [NamespaceDeclaration] module ... } } } |
1431+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | semmle.order | 85 |
14311432
| tst.ts:390:8:390:11 | [VarDecl] TS49 | semmle.label | [VarDecl] TS49 |
14321433
| tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; |
14331434
| tst.ts:391:8:391:13 | [Identifier] Colors | semmle.label | [Identifier] Colors |
@@ -1506,6 +1507,23 @@ nodes
15061507
| tst.ts:414:11:414:11 | [VarDecl] h | semmle.label | [VarDecl] h |
15071508
| tst.ts:414:11:414:19 | [VariableDeclarator] h = color | semmle.label | [VariableDeclarator] h = color |
15081509
| tst.ts:414:15:414:19 | [VarRef] color | semmle.label | [VarRef] color |
1510+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | semmle.label | [ClassDefinition,TypeDefinition] class P ... } } |
1511+
| tst.ts:419:9:419:14 | [VarDecl] Person | semmle.label | [VarDecl] Person |
1512+
| tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | semmle.label | [FieldDeclaration] accesso ... string; |
1513+
| tst.ts:420:14:420:17 | [Label] name | semmle.label | [Label] name |
1514+
| tst.ts:420:20:420:25 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
1515+
| tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | semmle.label | [ClassInitializedMember,ConstructorDefinition] constru ... ; } |
1516+
| tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | semmle.label | [FunctionExpr] constru ... ; } |
1517+
| tst.ts:422:5:424:5 | [Label] constructor | semmle.label | [Label] constructor |
1518+
| tst.ts:422:17:422:20 | [SimpleParameter] name | semmle.label | [SimpleParameter] name |
1519+
| tst.ts:422:23:422:28 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
1520+
| tst.ts:422:31:424:5 | [BlockStmt] { ... ; } | semmle.label | [BlockStmt] { ... ; } |
1521+
| tst.ts:423:7:423:10 | [ThisExpr] this | semmle.label | [ThisExpr] this |
1522+
| tst.ts:423:7:423:15 | [DotExpr] this.name | semmle.label | [DotExpr] this.name |
1523+
| tst.ts:423:7:423:22 | [AssignExpr] this.name = name | semmle.label | [AssignExpr] this.name = name |
1524+
| tst.ts:423:7:423:23 | [ExprStmt] this.name = name; | semmle.label | [ExprStmt] this.name = name; |
1525+
| tst.ts:423:12:423:15 | [Label] name | semmle.label | [Label] name |
1526+
| tst.ts:423:19:423:22 | [VarRef] name | semmle.label | [VarRef] name |
15091527
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.label | [ExportDeclaration] export ... 'b'; } |
15101528
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.order | 86 |
15111529
| tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | [FunctionDeclStmt] functio ... 'b'; } |
@@ -2003,6 +2021,8 @@ edges
20032021
| file://:0:0:0:0 | (Parameters) | tst.ts:383:46:383:46 | [SimpleParameter] y | semmle.order | 1 |
20042022
| file://:0:0:0:0 | (Parameters) | tst.ts:412:21:412:25 | [SimpleParameter] color | semmle.label | 0 |
20052023
| file://:0:0:0:0 | (Parameters) | tst.ts:412:21:412:25 | [SimpleParameter] color | semmle.order | 0 |
2024+
| file://:0:0:0:0 | (Parameters) | tst.ts:422:17:422:20 | [SimpleParameter] name | semmle.label | 0 |
2025+
| file://:0:0:0:0 | (Parameters) | tst.ts:422:17:422:20 | [SimpleParameter] name | semmle.order | 0 |
20062026
| file://:0:0:0:0 | (Parameters) | type_alias.ts:14:10:14:17 | [SimpleParameter] property | semmle.label | 0 |
20072027
| file://:0:0:0:0 | (Parameters) | type_alias.ts:14:10:14:17 | [SimpleParameter] property | semmle.order | 0 |
20082028
| file://:0:0:0:0 | (Parameters) | type_alias.ts:21:19:21:21 | [SimpleParameter] key | semmle.label | 0 |
@@ -4289,22 +4309,24 @@ edges
42894309
| tst.ts:385:55:385:72 | [ArrayExpr] [0, false, "bye!"] | tst.ts:385:59:385:63 | [Literal] false | semmle.order | 2 |
42904310
| tst.ts:385:55:385:72 | [ArrayExpr] [0, false, "bye!"] | tst.ts:385:66:385:71 | [Literal] "bye!" | semmle.label | 3 |
42914311
| tst.ts:385:55:385:72 | [ArrayExpr] [0, false, "bye!"] | tst.ts:385:66:385:71 | [Literal] "bye!" | semmle.order | 3 |
4292-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:390:8:390:11 | [VarDecl] TS49 | semmle.label | 1 |
4293-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:390:8:390:11 | [VarDecl] TS49 | semmle.order | 1 |
4294-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | semmle.label | 2 |
4295-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | semmle.order | 2 |
4296-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:393:3:393:56 | [TypeAliasDeclaration,TypeDefinition] type RG ... umber]; | semmle.label | 3 |
4297-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:393:3:393:56 | [TypeAliasDeclaration,TypeDefinition] type RG ... umber]; | semmle.order | 3 |
4298-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:395:3:399:43 | [DeclStmt] const palette = ... | semmle.label | 4 |
4299-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:395:3:399:43 | [DeclStmt] const palette = ... | semmle.order | 4 |
4300-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:402:3:402:41 | [DeclStmt] const redComponent = ... | semmle.label | 5 |
4301-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:402:3:402:41 | [DeclStmt] const redComponent = ... | semmle.order | 5 |
4302-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:404:3:406:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.label | 6 |
4303-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:404:3:406:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.order | 6 |
4304-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:408:3:410:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.label | 7 |
4305-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:408:3:410:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.order | 7 |
4306-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:412:3:416:3 | [FunctionDeclStmt] functio ... } } | semmle.label | 8 |
4307-
| tst.ts:390:1:417:1 | [NamespaceDeclaration] module ... } } } | tst.ts:412:3:416:3 | [FunctionDeclStmt] functio ... } } | semmle.order | 8 |
4312+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:390:8:390:11 | [VarDecl] TS49 | semmle.label | 1 |
4313+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:390:8:390:11 | [VarDecl] TS49 | semmle.order | 1 |
4314+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | semmle.label | 2 |
4315+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | semmle.order | 2 |
4316+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:393:3:393:56 | [TypeAliasDeclaration,TypeDefinition] type RG ... umber]; | semmle.label | 3 |
4317+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:393:3:393:56 | [TypeAliasDeclaration,TypeDefinition] type RG ... umber]; | semmle.order | 3 |
4318+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:395:3:399:43 | [DeclStmt] const palette = ... | semmle.label | 4 |
4319+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:395:3:399:43 | [DeclStmt] const palette = ... | semmle.order | 4 |
4320+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:402:3:402:41 | [DeclStmt] const redComponent = ... | semmle.label | 5 |
4321+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:402:3:402:41 | [DeclStmt] const redComponent = ... | semmle.order | 5 |
4322+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:404:3:406:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.label | 6 |
4323+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:404:3:406:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.order | 6 |
4324+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:408:3:410:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.label | 7 |
4325+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:408:3:410:3 | [InterfaceDeclaration,TypeDefinition] interfa ... er; } | semmle.order | 7 |
4326+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:412:3:416:3 | [FunctionDeclStmt] functio ... } } | semmle.label | 8 |
4327+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:412:3:416:3 | [FunctionDeclStmt] functio ... } } | semmle.order | 8 |
4328+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | semmle.label | 9 |
4329+
| tst.ts:390:1:426:1 | [NamespaceDeclaration] module ... } } } | tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | semmle.order | 9 |
43084330
| tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | tst.ts:391:8:391:13 | [Identifier] Colors | semmle.label | 1 |
43094331
| tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | tst.ts:391:8:391:13 | [Identifier] Colors | semmle.order | 1 |
43104332
| tst.ts:391:3:391:41 | [TypeAliasDeclaration,TypeDefinition] type Co ... "blue"; | tst.ts:391:17:391:40 | [UnionTypeExpr] "red" \| ... "blue" | semmle.label | 2 |
@@ -4445,6 +4467,38 @@ edges
44454467
| tst.ts:414:11:414:19 | [VariableDeclarator] h = color | tst.ts:414:11:414:11 | [VarDecl] h | semmle.order | 1 |
44464468
| tst.ts:414:11:414:19 | [VariableDeclarator] h = color | tst.ts:414:15:414:19 | [VarRef] color | semmle.label | 2 |
44474469
| tst.ts:414:11:414:19 | [VariableDeclarator] h = color | tst.ts:414:15:414:19 | [VarRef] color | semmle.order | 2 |
4470+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | tst.ts:419:9:419:14 | [VarDecl] Person | semmle.label | 1 |
4471+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | tst.ts:419:9:419:14 | [VarDecl] Person | semmle.order | 1 |
4472+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | semmle.label | 2 |
4473+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | semmle.order | 2 |
4474+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | semmle.label | 3 |
4475+
| tst.ts:419:3:425:3 | [ClassDefinition,TypeDefinition] class P ... } } | tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | semmle.order | 3 |
4476+
| tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | tst.ts:420:14:420:17 | [Label] name | semmle.label | 1 |
4477+
| tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | tst.ts:420:14:420:17 | [Label] name | semmle.order | 1 |
4478+
| tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | tst.ts:420:20:420:25 | [KeywordTypeExpr] string | semmle.label | 2 |
4479+
| tst.ts:420:5:420:26 | [FieldDeclaration] accesso ... string; | tst.ts:420:20:420:25 | [KeywordTypeExpr] string | semmle.order | 2 |
4480+
| tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | semmle.label | 2 |
4481+
| tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | semmle.order | 2 |
4482+
| tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | tst.ts:422:5:424:5 | [Label] constructor | semmle.label | 1 |
4483+
| tst.ts:422:5:424:5 | [ClassInitializedMember,ConstructorDefinition] constru ... ; } | tst.ts:422:5:424:5 | [Label] constructor | semmle.order | 1 |
4484+
| tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | file://:0:0:0:0 | (Parameters) | semmle.label | 1 |
4485+
| tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | file://:0:0:0:0 | (Parameters) | semmle.order | 1 |
4486+
| tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | tst.ts:422:31:424:5 | [BlockStmt] { ... ; } | semmle.label | 5 |
4487+
| tst.ts:422:5:424:5 | [FunctionExpr] constru ... ; } | tst.ts:422:31:424:5 | [BlockStmt] { ... ; } | semmle.order | 5 |
4488+
| tst.ts:422:17:422:20 | [SimpleParameter] name | tst.ts:422:23:422:28 | [KeywordTypeExpr] string | semmle.label | 0 |
4489+
| tst.ts:422:17:422:20 | [SimpleParameter] name | tst.ts:422:23:422:28 | [KeywordTypeExpr] string | semmle.order | 0 |
4490+
| tst.ts:422:31:424:5 | [BlockStmt] { ... ; } | tst.ts:423:7:423:23 | [ExprStmt] this.name = name; | semmle.label | 1 |
4491+
| tst.ts:422:31:424:5 | [BlockStmt] { ... ; } | tst.ts:423:7:423:23 | [ExprStmt] this.name = name; | semmle.order | 1 |
4492+
| tst.ts:423:7:423:15 | [DotExpr] this.name | tst.ts:423:7:423:10 | [ThisExpr] this | semmle.label | 1 |
4493+
| tst.ts:423:7:423:15 | [DotExpr] this.name | tst.ts:423:7:423:10 | [ThisExpr] this | semmle.order | 1 |
4494+
| tst.ts:423:7:423:15 | [DotExpr] this.name | tst.ts:423:12:423:15 | [Label] name | semmle.label | 2 |
4495+
| tst.ts:423:7:423:15 | [DotExpr] this.name | tst.ts:423:12:423:15 | [Label] name | semmle.order | 2 |
4496+
| tst.ts:423:7:423:22 | [AssignExpr] this.name = name | tst.ts:423:7:423:15 | [DotExpr] this.name | semmle.label | 1 |
4497+
| tst.ts:423:7:423:22 | [AssignExpr] this.name = name | tst.ts:423:7:423:15 | [DotExpr] this.name | semmle.order | 1 |
4498+
| tst.ts:423:7:423:22 | [AssignExpr] this.name = name | tst.ts:423:19:423:22 | [VarRef] name | semmle.label | 2 |
4499+
| tst.ts:423:7:423:22 | [AssignExpr] this.name = name | tst.ts:423:19:423:22 | [VarRef] name | semmle.order | 2 |
4500+
| tst.ts:423:7:423:23 | [ExprStmt] this.name = name; | tst.ts:423:7:423:22 | [AssignExpr] this.name = name | semmle.label | 1 |
4501+
| tst.ts:423:7:423:23 | [ExprStmt] this.name = name; | tst.ts:423:7:423:22 | [AssignExpr] this.name = name | semmle.order | 1 |
44484502
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | 1 |
44494503
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.order | 1 |
44504504
| tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | tstModuleCJS.cts:1:17:1:28 | [VarDecl] tstModuleCJS | semmle.label | 0 |

javascript/ql/test/library-tests/TypeScript/Types/tests.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,14 @@ getExprType
552552
| tst.ts:413:18:413:22 | color | RGBObj \| HSVObj |
553553
| tst.ts:414:11:414:11 | h | HSVObj |
554554
| tst.ts:414:15:414:19 | color | HSVObj |
555+
| tst.ts:419:9:419:14 | Person | Person |
556+
| tst.ts:420:14:420:17 | name | string |
557+
| tst.ts:422:5:424:5 | constru ... ;\\n } | any |
558+
| tst.ts:422:17:422:20 | name | string |
559+
| tst.ts:423:7:423:15 | this.name | string |
560+
| tst.ts:423:7:423:22 | this.name = name | string |
561+
| tst.ts:423:12:423:15 | name | string |
562+
| tst.ts:423:19:423:22 | name | string |
555563
| tstModuleCJS.cts:1:17:1:28 | tstModuleCJS | () => "a" \| "b" |
556564
| tstModuleCJS.cts:2:12:2:15 | Math | Math |
557565
| tstModuleCJS.cts:2:12:2:22 | Math.random | () => number |
@@ -661,6 +669,7 @@ getTypeDefinitionType
661669
| tst.ts:393:3:393:56 | type RG ... umber]; | RGB |
662670
| tst.ts:404:3:406:3 | interfa ... er;\\n } | RGBObj |
663671
| tst.ts:408:3:410:3 | interfa ... er;\\n } | HSVObj |
672+
| tst.ts:419:3:425:3 | class P ... }\\n } | Person |
664673
| type_alias.ts:1:1:1:17 | type B = boolean; | boolean |
665674
| type_alias.ts:5:1:5:50 | type Va ... ay<T>>; | ValueOrArray<T> |
666675
| type_alias.ts:9:1:15:13 | type Js ... Json[]; | Json |
@@ -984,6 +993,8 @@ getTypeExprType
984993
| tst.ts:412:28:412:33 | RGBObj | RGBObj |
985994
| tst.ts:412:28:412:42 | RGBObj \| HSVObj | RGBObj \| HSVObj |
986995
| tst.ts:412:37:412:42 | HSVObj | HSVObj |
996+
| tst.ts:420:20:420:25 | string | string |
997+
| tst.ts:422:23:422:28 | string | string |
987998
| tstModuleCJS.cts:1:33:1:35 | 'a' | "a" |
988999
| tstModuleCJS.cts:1:33:1:41 | 'a' \| 'b' | "a" \| "b" |
9891000
| tstModuleCJS.cts:1:39:1:41 | 'b' | "b" |
@@ -1088,6 +1099,7 @@ referenceDefinition
10881099
| MyUnion2 | tst.ts:68:1:68:49 | type My ... true}; |
10891100
| NonAbstractDummy | tst.ts:54:1:56:1 | interfa ... mber;\\n} |
10901101
| Person | tst.ts:222:3:234:3 | class P ... }\\n } |
1102+
| Person | tst.ts:419:3:425:3 | class P ... }\\n } |
10911103
| RGB | tst.ts:393:3:393:56 | type RG ... umber]; |
10921104
| RGBObj | tst.ts:404:3:406:3 | interfa ... er;\\n } |
10931105
| Shape | tst.ts:140:3:142:47 | type Sh ... mber }; |

javascript/ql/test/library-tests/TypeScript/Types/tst.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,4 +414,13 @@ module TS49 {
414414
let h = color; // <- HSVObj
415415
}
416416
}
417+
418+
// auto-accessors
419+
class Person {
420+
accessor name: string; // behaves as a normal field for our purposes
421+
422+
constructor(name: string) {
423+
this.name = name;
424+
}
425+
}
417426
}

0 commit comments

Comments
 (0)