mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
JS: Merge TypeScript/CallSignatures test
This commit is contained in:
@@ -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 |
|
||||
@@ -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
|
||||
@@ -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 |
|
||||
@@ -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
|
||||
@@ -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 |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from MethodDeclaration method
|
||||
select method, "Method " + method.getName() + " in " + method.getDeclaringType().describe()
|
||||
@@ -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 |
|
||||
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user