JS: Merge TypeScript/CallSignatures test

This commit is contained in:
Asger F
2019-09-18 11:04:12 +01:00
parent 3f3b0e5149
commit 8ca294ae41
8 changed files with 29 additions and 23 deletions

View File

@@ -1,4 +0,0 @@
| tst.ts:7:3:7:22 | (x: number): number; | interface I | tst.ts:7:3:7:22 | (x: number): number; | abstract |
| tst.ts:8:3:8:21 | new (x: number): C; | interface I | tst.ts:8:3:8:21 | new (x: number): C; | abstract |
| tst.ts:13:3:13:22 | (x: number): number; | anonymous interface | tst.ts:13:3:13:22 | (x: number): number; | abstract |
| tst.ts:14:3:14:21 | new (x: number): C; | anonymous interface | tst.ts:14:3:14:21 | new (x: number): C; | abstract |

View File

@@ -1,5 +0,0 @@
import javascript
from CallSignature call, string abstractness
where if call.isAbstract() then abstractness = "abstract" else abstractness = "not abstract"
select call, call.getDeclaringType().describe(), call.getBody(), abstractness

View File

@@ -1,2 +0,0 @@
| tst.ts:9:3:9:22 | [x: number]: string; | interface I | tst.ts:9:3:9:22 | [x: number]: string; | abstract |
| tst.ts:15:3:15:22 | [x: number]: string; | anonymous interface | tst.ts:15:3:15:22 | [x: number]: string; | abstract |

View File

@@ -1,5 +0,0 @@
import javascript
from IndexSignature sig, string abstractness
where if sig.isAbstract() then abstractness = "abstract" else abstractness = "not abstract"
select sig, sig.getDeclaringType().describe(), sig.getBody(), abstractness

View File

@@ -1,3 +0,0 @@
| tst.ts:1:18:1:17 | constructor() {} | Method constructor in class C |
| tst.ts:2:3:2:31 | abstrac ... number; | Method abstract in class C |
| tst.ts:3:3:3:30 | abstrac ... er): C; | Method new in class C |

View File

@@ -1,4 +0,0 @@
import javascript
from MethodDeclaration method
select method, "Method " + method.getName() + " in " + method.getDeclaringType().describe()

View File

@@ -0,0 +1,12 @@
test_CallSignature
| tst.ts:7:3:7:22 | (x: number): number; | interface I | tst.ts:7:3:7:22 | (x: number): number; | abstract |
| tst.ts:8:3:8:21 | new (x: number): C; | interface I | tst.ts:8:3:8:21 | new (x: number): C; | abstract |
| tst.ts:13:3:13:22 | (x: number): number; | anonymous interface | tst.ts:13:3:13:22 | (x: number): number; | abstract |
| tst.ts:14:3:14:21 | new (x: number): C; | anonymous interface | tst.ts:14:3:14:21 | new (x: number): C; | abstract |
test_IndexSignature
| tst.ts:9:3:9:22 | [x: number]: string; | interface I | tst.ts:9:3:9:22 | [x: number]: string; | abstract |
| tst.ts:15:3:15:22 | [x: number]: string; | anonymous interface | tst.ts:15:3:15:22 | [x: number]: string; | abstract |
test_MethodDeclarations
| tst.ts:1:18:1:17 | constructor() {} | Method constructor in class C |
| tst.ts:2:3:2:31 | abstrac ... number; | Method abstract in class C |
| tst.ts:3:3:3:30 | abstrac ... er): C; | Method new in class C |

View File

@@ -0,0 +1,17 @@
import javascript
query predicate test_CallSignature(CallSignature call, string declType, ASTNode body, string abstractness) {
(if call.isAbstract() then abstractness = "abstract" else abstractness = "not abstract") and
declType = call.getDeclaringType().describe() and
body = call.getBody()
}
query predicate test_IndexSignature(IndexSignature sig, string declType, ASTNode body, string abstractness) {
(if sig.isAbstract() then abstractness = "abstract" else abstractness = "not abstract") and
declType = sig.getDeclaringType().describe() and
body = sig.getBody()
}
query predicate test_MethodDeclarations(MethodDeclaration method, string descr) {
descr = "Method " + method.getName() + " in " + method.getDeclaringType().describe()
}