JS: change alert location for js/incomplete-object-initialization

This commit is contained in:
Esben Sparre Andreasen
2018-08-08 10:29:56 +02:00
parent 1a5585c83c
commit e1947f04df
4 changed files with 23 additions and 13 deletions

View File

@@ -59,4 +59,4 @@ where needsGuard(e, kind) and unguarded(e, ctor) and
sc.getBinder() = ctor and
sc.getEnclosingFunction() != ctor
)
select e, "The super constructor must be called before using '" + kind + "'."
select ctor, "The super constructor must be called before using '$@'.", e, kind

View File

@@ -1,12 +1,14 @@
| invalid.js:5:40:5:43 | this | The super constructor must be called before using 'this'. |
| invalid.js:6:40:6:43 | this | The super constructor must be called before using 'this'. |
| invalid.js:7:40:7:46 | super.c | The super constructor must be called before using 'super'. |
| invalid.js:8:40:8:43 | this | The super constructor must be called before using 'this'. |
| invalid.js:9:40:9:43 | this | The super constructor must be called before using 'this'. |
| invalid.js:10:40:10:46 | super.c | The super constructor must be called before using 'super'. |
| invalid.js:11:46:11:49 | this | The super constructor must be called before using 'this'. |
| invalid.js:12:46:12:49 | this | The super constructor must be called before using 'this'. |
| invalid.js:13:46:13:52 | super.c | The super constructor must be called before using 'super'. |
| invalid.js:14:99:14:102 | this | The super constructor must be called before using 'this'. |
| invalid.js:15:76:15:79 | this | The super constructor must be called before using 'this'. |
| invalid.js:16:56:16:59 | this | The super constructor must be called before using 'this'. |
| invalid.js:5:35:5:52 | () { this.c = 0; } | The super constructor must be called before using '$@'. | invalid.js:5:40:5:43 | this | this |
| invalid.js:6:35:6:50 | () { this.c(); } | The super constructor must be called before using '$@'. | invalid.js:6:40:6:43 | this | this |
| invalid.js:7:35:7:51 | () { super.c(); } | The super constructor must be called before using '$@'. | invalid.js:7:40:7:46 | super.c | super |
| invalid.js:8:35:8:61 | () { th ... er(); } | The super constructor must be called before using '$@'. | invalid.js:8:40:8:43 | this | this |
| invalid.js:9:35:9:59 | () { th ... er(); } | The super constructor must be called before using '$@'. | invalid.js:9:40:9:43 | this | this |
| invalid.js:10:35:10:60 | () { su ... er(); } | The super constructor must be called before using '$@'. | invalid.js:10:40:10:46 | super.c | super |
| invalid.js:11:35:11:55 | () { su ... s.c); } | The super constructor must be called before using '$@'. | invalid.js:11:46:11:49 | this | this |
| invalid.js:12:35:12:57 | () { su ... c()); } | The super constructor must be called before using '$@'. | invalid.js:12:46:12:49 | this | this |
| invalid.js:13:35:13:58 | () { su ... c()); } | The super constructor must be called before using '$@'. | invalid.js:13:46:13:52 | super.c | super |
| invalid.js:14:35:14:118 | () { cl ... er(); } | The super constructor must be called before using '$@'. | invalid.js:14:99:14:102 | this | this |
| invalid.js:15:71:15:95 | () { th ... er(); } | The super constructor must be called before using '$@'. | invalid.js:15:76:15:79 | this | this |
| invalid.js:16:35:16:66 | () { if ... .a(); } | The super constructor must be called before using '$@'. | invalid.js:16:56:16:59 | this | this |
| invalid.js:26:16:29:5 | () {\\n ... ;\\n } | The super constructor must be called before using '$@'. | invalid.js:27:9:27:12 | this | this |
| invalid.js:26:16:29:5 | () {\\n ... ;\\n } | The super constructor must be called before using '$@'. | invalid.js:28:9:28:12 | this | this |

View File

@@ -21,3 +21,10 @@ class A41 extends B1 { constructor() { if (a) super(); this.a(); } }
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() {
this.p1 = 0;
this.p2 = 0;
}
}