mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Merge remote-tracking branch 'upstream/rc/1.20' into merge/rc/1.20
This commit is contained in:
@@ -154,6 +154,9 @@ where
|
||||
or
|
||||
// exclude result from js/overwritten-property
|
||||
assign2.getBase() instanceof DataFlow::ObjectLiteralNode
|
||||
or
|
||||
// exclude result from accessor declarations
|
||||
assign1.getWriteNode() instanceof AccessorMethodDeclaration
|
||||
)
|
||||
select assign1.getWriteNode(),
|
||||
"This write to property '" + name + "' is useless, since $@ always overrides it.",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
| in unknown scope |
|
||||
| Array in global scope |
|
||||
| Intl in global scope |
|
||||
| Intl.CollatorOptions in global scope |
|
||||
| Intl.NumberFormatOptions in global scope |
|
||||
| MK in unknown scope |
|
||||
| Mapped in test.ts |
|
||||
| RegExp in global scope |
|
||||
| RegExpMatchArray in global scope |
|
||||
| fn in test.ts |
|
||||
| test.ts |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from CanonicalName name
|
||||
select name
|
||||
@@ -0,0 +1,9 @@
|
||||
type Mapped<MK extends string = ''> = {
|
||||
[mk in MK]: string
|
||||
};
|
||||
|
||||
export function fn(ev: Mapped) {
|
||||
const props: Mapped = {
|
||||
...ev
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"include": ["."]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
| Bar.Foo in global scope | Bar in global scope |
|
||||
| Intl.CollatorOptions in global scope | Intl in global scope |
|
||||
| Intl.NumberFormatOptions in global scope | Intl in global scope |
|
||||
| fn in test.ts | test.ts |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from CanonicalName typename
|
||||
select typename, typename.getParent()
|
||||
@@ -0,0 +1,9 @@
|
||||
type Mapped<MK extends string = ';'> = {
|
||||
[mk in MK]: string
|
||||
};
|
||||
|
||||
export function fn(ev: Mapped) {
|
||||
const props: Mapped = {
|
||||
...ev
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"include": ["."]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Bar {
|
||||
|
||||
export interface Foo {
|
||||
[";x"]: number;
|
||||
w: number;
|
||||
}
|
||||
|
||||
let x : Foo;
|
||||
|
||||
}
|
||||
|
||||
let y: Bar.Foo;
|
||||
let z: typeof Bar[";"];
|
||||
@@ -150,6 +150,7 @@ test_IsTypeExpr
|
||||
| tst.ts:81:38:81:50 | x is typeof x | tst.ts:81:38:81:38 | x | tst.ts:81:43:81:50 | typeof x |
|
||||
test_ThisParameterTypes
|
||||
| function hasThisParam | tst.ts:116:29:116:32 | void |
|
||||
| method hasThisParam of interface InterfaceWithThisParam | tst.ts:119:22:119:43 | Interfa ... isParam |
|
||||
test_ChildIndex
|
||||
test_TypeArguments
|
||||
| tst.ts:102:13:102:29 | f1<string>("foo") | 0 | 1 | tst.ts:102:16:102:21 | string |
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
static get foo() {} // OK
|
||||
static set foo(v) {} // OK
|
||||
|
||||
get bar() {} // OK
|
||||
set bar(v) {} // OK
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Foo, Bar, Baz } from "somewhere"; // OK
|
||||
|
||||
export function f(this: Foo) {}
|
||||
|
||||
export class C {
|
||||
m(this: Bar) {}
|
||||
}
|
||||
|
||||
export default {
|
||||
foo(this: Baz) {}
|
||||
}
|
||||
Reference in New Issue
Block a user