- class A:
- def f() = println("A.f")
- class B extends A:
- override def f() =
- println("B.f")
- super.f()
- end f
- def g() = println("B.g")
- val b:A = new B()
- b.f()
- let a = {
- f: function() {
- console.log("A.f"); }
- }
- let b = {
- f: function() {
- console.log("B.f");
- this.__proto__.f(); },
- g: function() {
- console.log("B.g"); }
- }
- b.__proto__ = a
- b.f();