2018-03-28 19:41:24 +02:00
|
|
|
// @noEmit: true
|
|
|
|
// @checkJs: true
|
|
|
|
// @allowJs: true
|
|
|
|
// @Filename: a.js
|
2018-04-02 19:11:39 +02:00
|
|
|
class B {
|
|
|
|
constructor () {
|
|
|
|
this.n = 1
|
|
|
|
}
|
2018-03-28 19:41:24 +02:00
|
|
|
foo() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-02 19:11:39 +02:00
|
|
|
class C extends B { }
|
2018-03-28 19:41:24 +02:00
|
|
|
|
2018-04-02 19:11:39 +02:00
|
|
|
// this override should be fine (even if it's a little odd)
|
|
|
|
C.prototype.foo = function() {
|
2018-03-28 19:41:24 +02:00
|
|
|
}
|
|
|
|
|
2018-04-02 19:11:39 +02:00
|
|
|
class D extends B { }
|
|
|
|
D.prototype.foo = () => {
|
|
|
|
this.n = 'not checked, so no error'
|
2018-03-28 19:41:24 +02:00
|
|
|
}
|
2018-04-04 20:03:31 +02:00
|
|
|
|
|
|
|
// post-class prototype assignments are trying to show that these properties are abstract
|
|
|
|
class Module {
|
|
|
|
}
|
|
|
|
Module.prototype.identifier = undefined
|
|
|
|
Module.prototype.size = null
|
|
|
|
|
|
|
|
class NormalModule extends Module {
|
|
|
|
identifier() {
|
|
|
|
return 'normal'
|
|
|
|
}
|
|
|
|
size() {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|