JS: use inheritance in js/mixed-static-instance-this-access

This commit is contained in:
Esben Sparre Andreasen
2018-11-20 09:29:16 +01:00
parent 26a248b14a
commit caea6212ed
5 changed files with 41 additions and 3 deletions

View File

@@ -1,2 +1,3 @@
| instanceStatic.js:3:9:3:16 | this.baz | Access to instance method $@ from static method $@ is not possible through `this`. | instanceStatic.js:5:5:7:5 | baz(){\\n\\n } | baz | instanceStatic.js:2:5:4:5 | static ... K\\n } | bar |
| staticInstance.js:3:9:3:16 | this.baz | Access to static method $@ from instance method $@ is not possible through `this`. | staticInstance.js:5:5:6:5 | static baz(){\\n } | baz | staticInstance.js:2:5:4:5 | bar(){\\n ... K\\n } | bar |
| tst.js:66:9:66:14 | this.f | Access to instance method $@ from static method $@ is not possible through `this`. | tst.js:60:5:62:5 | f() {\\n\\n } | f | tst.js:65:5:67:5 | static ... K\\n } | test |

View File

@@ -41,3 +41,28 @@ class C4 {
}
}
C4.f = x;
class C5_super {
f() {
}
}
class C5 extends C5_super{
static f() {
}
test() {
this.f; // OK
}
}
class C6_super {
f() {
}
}
class C6 extends C6_super{
static test() {
this.f; // NOT OK
}
}