mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
This adds Alert annotations for alerts that seem intentional by the test but has not been annotated with 'NOT OK', or the comment was in the wrong place. In a few cases I included 'Source' expectations to make it easier to see what happened. Other 'Source' expectations will be added in bulk a later commit.
31 lines
1.6 KiB
JavaScript
31 lines
1.6 KiB
JavaScript
// Adapted from https://github.com/eslint/eslint, which is licensed
|
|
// under the MIT license; see file LICENSE.
|
|
|
|
class B1 {}
|
|
class A30 extends B1 { constructor() { this.c = 0; } } // $ Alert
|
|
class A31 extends B1 { constructor() { this.c(); } } // $ Alert
|
|
class A32 extends B1 { constructor() { super.c(); } } // $ Alert
|
|
class A33 extends B1 { constructor() { this.c = 0; super(); } } // $ Alert
|
|
class A34 extends B1 { constructor() { this.c(); super(); } } // $ Alert
|
|
class A35 extends B1 { constructor() { super.c(); super(); } } // $ Alert
|
|
class A36 extends B1 { constructor() { super(this.c); } } // $ Alert
|
|
class A37 extends B1 { constructor() { super(this.c()); } } // $ Alert
|
|
class A38 extends B1 { constructor() { super(super.c()); } } // $ Alert
|
|
class A39 extends B1 { constructor() { class C extends D { constructor() { super(); this.e(); } } this.f(); super(); } } // $ Alert
|
|
class A40 extends B1 { constructor() { class C extends D { constructor() { this.e(); super(); } } super(); this.f(); } } // $ Alert
|
|
class A41 extends B1 { constructor() { if (a) super(); this.a(); } } // $ Alert
|
|
|
|
// the following two cases are not currently detected (even though they should be):
|
|
// while `this` is, in both cases, guarded by a `super` call, the call does not complete
|
|
// normally, leading to a runtime error
|
|
class B2 { constructor() { throw ""; } }
|
|
class A42 extends B2 { constructor() { try { super(); } finally { this.a; } } }
|
|
class A43 extends B2 { constructor() { try { super(); } catch (err) { } this.a; } }
|
|
|
|
class A44 extends B1 {
|
|
constructor() { // $ Alert
|
|
this.p1 = 0;
|
|
this.p2 = 0;
|
|
}
|
|
}
|